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