本文整理汇总了Python中WMCore.FwkJobReport.Report.addAttributesToFile方法的典型用法代码示例。如果您正苦于以下问题:Python Report.addAttributesToFile方法的具体用法?Python Report.addAttributesToFile怎么用?Python Report.addAttributesToFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMCore.FwkJobReport.Report
的用法示例。
在下文中一共展示了Report.addAttributesToFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: inputFileHandler
# 需要导入模块: from WMCore.FwkJobReport import Report [as 别名]
# 或者: from WMCore.FwkJobReport.Report import addAttributesToFile [as 别名]
def inputFileHandler(targets):
"""
_inputFileHandler_
coroutine to create input files in the report and dispatch
sub data down the pipeline
"""
while True:
report, node = (yield)
moduleName = None
moduleNode = [ x for x in node.children if x.name == "ModuleLabel"][0]
moduleName = moduleNode.text
moduleRef = report.addInputSource(moduleName)
fileRef = report.addInputFile(moduleName)
fileAttrs = {}
for subnode in node.children:
if subnode.name == "Runs":
targets['Runs'].send( (fileRef, subnode) )
elif subnode.name == "Branches":
targets['Branches'].send( (fileRef, subnode) )
else:
fileAttrs[subnode.name] = subnode.text
Report.addAttributesToFile(fileRef, lfn = fileAttrs["LFN"],
pfn = fileAttrs["PFN"], catalog = fileAttrs["Catalog"],
module_label = fileAttrs["ModuleLabel"],
guid = fileAttrs["GUID"], input_type = fileAttrs["InputType"],
input_source_class = fileAttrs["InputSourceClass"],
events = int(fileAttrs["EventsRead"]))
[fileRef]
示例2: fileHandler
# 需要导入模块: from WMCore.FwkJobReport import Report [as 别名]
# 或者: from WMCore.FwkJobReport.Report import addAttributesToFile [as 别名]
def fileHandler(targets):
"""
_fileHandler_
coroutine to create files and handle sub data in the appropriate
dispatchers
"""
while True:
report, node = (yield)
moduleName = None
moduleNode = [x for x in node.children if x.name == "ModuleLabel"][0]
moduleName = moduleNode.text
moduleRef = report.addOutputModule(moduleName)
fileRef = report.addOutputFile(moduleName)
fileAttrs = {}
for subnode in node.children:
if subnode.name == "Inputs":
targets["Inputs"].send((fileRef, subnode))
elif subnode.name == "Runs":
targets["Runs"].send((fileRef, subnode))
elif subnode.name == "Branches":
targets["Branches"].send((fileRef, subnode))
else:
fileAttrs[subnode.name] = subnode.text
Report.addAttributesToFile(
fileRef,
lfn=fileAttrs["LFN"],
pfn=fileAttrs["PFN"],
catalog=fileAttrs["Catalog"],
module_label=fileAttrs["ModuleLabel"],
guid=fileAttrs["GUID"],
ouput_module_class=fileAttrs["OutputModuleClass"],
events=int(fileAttrs["TotalEvents"]),
branch_hash=fileAttrs["BranchHash"],
)
[fileRef]