16 from __future__
import print_function
18 __author__ =
"Sebastien Binet"
23 from optparse
import OptionParser
25 if __name__ ==
"__main__":
27 parser = OptionParser(usage=
"usage: %prog [options] [-r] ref.pkl [-f] chk.pkl")
28 parser.add_option(
"-r",
31 help =
"The path to the first ConfigurationShelve file to analyze" )
32 parser.add_option(
"-f",
35 help =
"The path to the second ConfigurationShelve file to analyze" )
36 parser.add_option(
"-v",
38 action =
"store_true",
41 help =
"Switch to activate verbose printout" )
44 (options, args) = parser.parse_args()
46 if len(args) > 0
and args[0][0] !=
"-":
47 options.refFileName = args[0]
49 if len(args) > 1
and args[1][0] !=
"-":
50 options.fileName = args[1]
53 if options.fileName
is None or options.refFileName
is None :
54 str(parser.print_help()
or "")
58 chkFileName = os.path.expandvars(os.path.expanduser(options.fileName))
59 refFileName = os.path.expandvars(os.path.expanduser(options.refFileName))
61 print (
"::: comparing configurations:")
62 print (
"::: ref: %s" % refFileName)
63 print (
"::: chk: %s" % chkFileName)
64 from AthenaCommon.ConfigurationShelve
import cmpConfigs
65 ref, chk, report = cmpConfigs (ref=refFileName,
68 print (
"::: all good")
71 for l
in report:
print (l)
72 print (
"::: configurations differ !")