本文整理汇总了Python中pandatools.Client.getUserJobMetadata方法的典型用法代码示例。如果您正苦于以下问题:Python Client.getUserJobMetadata方法的具体用法?Python Client.getUserJobMetadata怎么用?Python Client.getUserJobMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandatools.Client
的用法示例。
在下文中一共展示了Client.getUserJobMetadata方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getUserJobMetadata
# 需要导入模块: from pandatools import Client [as 别名]
# 或者: from pandatools.Client import getUserJobMetadata [as 别名]
def getUserJobMetadata(self, jobID, output_filename):
job = self.getJobInfo(jobID)
# get logger
tmpLog = PLogger.getPandaLogger()
if job is None:
tmpLog.error('cannot find a task with {0}. May need to sync first'.format(jobID))
return False
# get metadata
task_id = job.jediTaskID
tmpLog.info('getting metadata')
status, metadata = Client.getUserJobMetadata(task_id, verbose=self.verbose)
if status != 0:
tmpLog.error(metadata)
tmpLog.error("Failed to get metadata")
return False
with open(output_filename, 'w') as f:
json.dump(metadata, f)
tmpLog.info('dumped to {0}'.format(output_filename))
# return
return True