class Game: def __init__(self): self.inp = Input() self.upd = Update() self.player1 = Player() self.out = Output() def update(self): self.inp.update(self.upd) self.upd.update(self.player1, self.out) self.out.update()
class Game: def __init__(self): print(protologue) self.inp = Input() self.upd = Update() self.world = World(3,4) self.player1 = Player(self.world) self.out = Output() def update(self): self.inp.update(self.upd) self.upd.update(self.player1, self.out, self.world) self.out.update()
def POST(self): if self.input['oper'] == 'del': d = Delete(self.input) return d.delete() elif self.input['oper'] == 'edit': u = Update(self.input) return u.update()
def POST(self): if self.input['oper'] == 'del': d = Delete(self.input) return d.delete() elif self.input['oper'] == 'edit': u = Update(self.input) return u.update()
def update(jdID, content): time1, date1, detail1, selftime1 = content['oSTime'], content['oDate'], content['oEvent'], content['oSeTime'] time2, date2, detail2, selftime2 = content['nSTime'], content['nDate'], content['nEvent'], content['nSeTime'] year1, month1, day1, hour1, minute1, __, detail1 = get_properties(date=date1, time=time1, detail=detail1) year2, month2, day2, hour2, minute2, __, detail2 = get_properties(date=date2, time=time2, detail=detail2) endtime = content['nETime'] selftime1 = None if 'value' not in selftime1 else selftime1['value'] selftime2 = None if 'value' not in selftime2 else selftime2['value'] detail2 = detail1 if detail2 is None else detail2 hour2 = hour1 if hour2 is None else hour2 minute2 = minute1 if minute2 is None else minute2 duration2 = get_duration(endate=date2, endtime=endtime, year=year2, month=month2, day=day2, hour=hour2, minute=minute2) e1 = Event(jdID=jdID, year=year1, month=month1, day=day1, hour=hour1, minute=minute1, isUpdate=True, event_detail=detail1) e2 = Event(jdID=jdID, year=year2, month=month2, day=day2, hour=hour2, minute=minute2, isUpdate=True, duration=duration2, event_detail=detail2) update = Update(db=db, jdID=jdID, old_event=e1, new_event=e2, old_selftime=selftime1, new_selftime=selftime2) rst = update.update() return rst
def states(): updater = Update("https://www.mohfw.gov.in/") history = updater.update(data) return jsonify(history)
params["action"] = "delete" if args.update : params["execute"] = True params["ip"] = [(s.connect(('8.8.8.8', 80)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1] services = [] linuxInstance = Linux(params) services.append(linuxInstance) if args.update : updateInstance = Update(params) updateInstance.update() exit() if args.withsql > 0 or args.delete > 0 : mysqlInstance = Mysql(params,linuxInstance) services.append(mysqlInstance) if args.withftp > 0 or args.delete > 0 : if args.withsql == 0 : mysqlInstance = Mysql(params,linuxInstance) pureftpInstance = Pureftp(params,mysqlInstance,linuxInstance) services.append(pureftpInstance) if args.withssh > 0 or args.delete > 0 : sshInstance = Ssh(params,linuxInstance) services.append(sshInstance)
def states(): with open("history.json", "r") as f: history = json.load(f) updater = Update("https://www.mohfw.gov.in/") history = updater.update(history) return jsonify(history)