ATLAS Offline Software
TriggerMenuXML2JSONConverter.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 
4 import sys
5 
6 def main():
7  if len(sys.argv)<=1:
8  print("please use this format:")
9  print("%s inputfile.xml [outputfile.json] ... menu file conversion" % sys.argv[0].rsplit('/')[-1])
10  print("%s inputfile.json ... json conformity check of any json file" % sys.argv[0].rsplit('/')[-1])
11  return 1
12 
13  inputfile = sys.argv[1]
14  outputfile = sys.argv[2] if len(sys.argv)>2 else None
15 
16  from TrigConfIO.MenuXML2JSONConverter import XML2JsonConverter
17  converter = XML2JsonConverter()
18 
19  if inputfile.endswith(".xml"):
20  converter.convertFile( inputfile, outputfile )
21  elif inputfile.endswith(".json"):
22  converter.checkJsonConformity( inputfile )
23 
24 if __name__=="__main__":
25  sys.exit(main())
TriggerMenuXML2JSONConverter.main
def main()
Definition: TriggerMenuXML2JSONConverter.py:6
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28