def do(self): decryptedFile = ExportTask.format_filename() encryptedFile = ExportTask.format_filename_processed(decryptedFile) dataset = self._get_data() datafile = helper.SHPDDataFile(encryptedFile, decryptedFile, dataset=dataset, file_type=helper.SHPDDataFile.TYPE_UPDATE) dataset = datafile.process() self._send_email(decryptedFile) 'save log' info_dict={} info_dict.update(dataset.get('header')); info_dict.update({'decryptedfile':decryptedFile, 'encryptedfile':self.encryptedFile}) log = Log() log.info = json.dumps(info_dict) log.identitiy = encryptedFile log.status = ExportTask.STATUS_DATA_LOADED log.op_id = self.operator_id log.save() 'archive file' datafile.archive()
def do(self): encryptedFile = UplaodFileTask.format_filename(self.uploadfilename) decryptedFile = UplaodFileTask.format_filename_processed(encryptedFile) datafile = helper.SHPDDataFile(self.encryptedFile, decryptedFile, helper.SHPDDataFile.TYPE_RECEIVE) dataset = datafile.process() 'save details' self.save2db(dataset.get('details')) 'save log' info_dict={} info_dict.update(dataset.get('header')); info_dict.update({'decryptedfile':decryptedFile, 'encryptedfile':self.encryptedFile}) log = Log() log.info = json.dumps(info_dict) log.identitiy = self.encryptedFile log.status = UplaodFileTask.STATUS_DATA_LOADED log.op_id = self.operator_id log.save() 'archive file' datafile.archive()