当前位置: 首页>>代码示例>>Python>>正文


Python Log.status方法代码示例

本文整理汇总了Python中models.Log.status方法的典型用法代码示例。如果您正苦于以下问题:Python Log.status方法的具体用法?Python Log.status怎么用?Python Log.status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Log的用法示例。


在下文中一共展示了Log.status方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: do

# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import status [as 别名]
 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()
开发者ID:privateprojects,项目名称:sosproject,代码行数:27,代码来源:task.py

示例2: error_log

# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import status [as 别名]
def error_log(last_log, **params):
	spreadsheetId = params["spreadsheetId"]
	output_spreadsheet = params["output_spreadsheet"]
	offset = params["offset"]
	tab = params["tab"]
	out = params["out"]
	if last_log.status == "Error":
		last_log.updated_row += 1
		last_log.save()
	else:
		last_log = Log(from_sheet=spreadsheetId, to_sheet=output_spreadsheet, from_tab=tab, to_tab=out)
		last_log.updated_range = '!A{}:M'.format(offset)
		last_log.updated_row = 1
		last_log.updated_col = 0
		last_log.status = "Error"
		last_log.save()
	return last_log
开发者ID:SnehaCredR,项目名称:Sheets,代码行数:19,代码来源:views.py

示例3: success_log

# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import status [as 别名]
def success_log(last_log, **params):
	spreadsheetId = params["spreadsheetId"]
	output_spreadsheet = params["output_spreadsheet"]
	tab = params["tab"]
	out = params["out"]
	body = params["body"]
	if last_log.status == "Success":
		last_log.updated_row += 1
		last_log.save()
	else:
		last_log = Log(from_sheet=spreadsheetId, to_sheet=output_spreadsheet, from_tab=tab, to_tab=out)
		last_log.updated_range = body["updatedRange"]
		last_log.updated_row = body["updatedRows"]
		last_log.updated_col = body["updatedColumns"]
		last_log.status = "Success"
		last_log.save()
	return last_log
开发者ID:SnehaCredR,项目名称:Sheets,代码行数:19,代码来源:views.py

示例4: read_to_db

# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import status [as 别名]
 def read_to_db(self, multiple_data):
     
     for email_digest, encryptedFile in multiple_data:
         
         'read data from file'
         decryptedFile = EmailTask.format_filename_processed(encryptedFile)
         datafile = helper.SHPDDataFile(encryptedFile, decryptedFile, helper.SHPDDataFile.TYPE_RECEIVE)
         dataset = datafile.process()
         
         'save details'
         self.save2db(dataset.get('details'))
         
         'save log'
         info = json.dumps(dict(status=EmailTask.STATUS_DOWNLOADED, encryptedfile=encryptedFile, decryptedfile=decryptedFile, header=dataset.get('header')))
         log = Log(identitiy=email_digest, type=Log.TYPE_CHOICES[1], info=info, status=0, op_id=0)
         log.status = EmailTask.STATUS_DATA_LOADED
         log.save()
         
         'archive file'
         datafile.archive()
开发者ID:privateprojects,项目名称:sosproject,代码行数:22,代码来源:task.py


注:本文中的models.Log.status方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。