ATLAS Offline Software
Loading...
Searching...
No Matches
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
4import sys
5
6def 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
24if __name__=="__main__":
25 sys.exit(main())
void print(char *figname, TCanvas *c1)