def updateData(self): if self.status == 'Stopped' and self.handle: db = simpleDB(self.handle) user = db.select(self.ctid) data = dict() param = FTPDownload.parameter param['host'] = user['labip'] param['ctid'] = user['ctid'] fd = ftpDownload(param) addr = fd.getAddr() if addr and (len(addr)>0): user['status'] = 'Stopped' user['addr'] = addr else: user['status'] = 'Failure' data[self.ctid] = user db.update(data)
def updateData(self): if self.status == 'Stopped' and self.handle: db = simpleDB(self.handle) item = db.select(self.ctid) data = dict() param = FTPDownload.parameter param['host'] = item['labip'] param['ctid'] = item['ctid'] fd = ftpDownload(param) addr = fd.getAddr() if addr and (len(addr)>0): item['status'] = 'Stopped' item['addr'] = addr else: item['status'] = 'Failure' db.add(item) db.close()
def updateData(self): if self.status == 'Stopped' and self.handle: db = simpleDB(self.handle) user = db.select(self.ctid) data = dict() param = SimpleFTP.parameter param['local'] = LOCAL param['labip'] = user['labip'] param['ctid'] = user['ctid'] addr = SimpleFTP.addr(param=param) if addr and len(addr)<120: user['status'] = 'Stopped' user['addr'] = addr else: user['status'] = 'Failure' data[self.ctid] = user db.update(data)
def saveData(self): user = {} param = {} if self.status == 'Started' and self.handle: sd = simpleDB(self.handle) TIMEFORMAT = '%Y-%m-%d %X' cnt = time.time()+time.altzone+8*3600 startime = time.strftime(TIMEFORMAT, time.localtime(cnt)) param['ctid'] = self.ctid param['duration'] = self.duration param['mode'] = self.mode param['labip'] = self.labip param['callid'] = self.callid param['matchdir'] = self.matchdir param['startime'] = startime param['time'] = time.time() param['status'] = self.status user[str(self.ctid)] = param sd.add(user)