Back to home page

Project CMSSW displayed by LXR

 
 

    


Warning, /FWCore/MessageLogger/scripts/edmFjrDump is written in an unsupported language. File is not indexed.

0001 #!/usr/bin/env python3
0002 
0003 import xml.etree.ElementTree as ET
0004 import argparse
0005 
0006 def printGUID(root):
0007     for f in root.findall("File"):
0008         print(f.find("GUID").text)
0009 
0010 def printExitCode(root):
0011     error = root.find("FrameworkError")
0012     if error is None:
0013         print("0")
0014         return
0015     print(error.get("ExitStatus"))
0016 
0017 def main(opts):
0018     tree = ET.parse(opts.file)
0019     root = tree.getroot()
0020     if opts.guid:
0021         printGUID(root)
0022     if opts.exitCode:
0023         printExitCode(root)
0024 
0025 if __name__ == "__main__":
0026     parser = argparse.ArgumentParser(description="Extract some values from the Framework Job Report")
0027     parser.add_argument("file", type=str,
0028                         help="Framework Job Report XML file")
0029     parser.add_argument("--guid", action="store_true",
0030                         help="GUID of the output file")
0031     parser.add_argument("--exitCode", action="store_true",
0032                         help="Job exit code")
0033 
0034     opts = parser.parse_args()
0035     main(opts)