16 __author__ =
"Sebastien Binet"
21 from optparse
import OptionParser
23 if __name__ ==
"__main__":
25 parser = OptionParser(usage=
"usage: %prog [options] [-r] ref.pkl [-f] chk.pkl")
26 parser.add_option(
"-r",
29 help =
"The path to the first ConfigurationShelve file to analyze" )
30 parser.add_option(
"-f",
33 help =
"The path to the second ConfigurationShelve file to analyze" )
34 parser.add_option(
"-v",
36 action =
"store_true",
39 help =
"Switch to activate verbose printout" )
42 (options, args) = parser.parse_args()
44 if len(args) > 0
and args[0][0] !=
"-":
45 options.refFileName = args[0]
47 if len(args) > 1
and args[1][0] !=
"-":
48 options.fileName = args[1]
51 if options.fileName
is None or options.refFileName
is None :
52 str(parser.print_help()
or "")
56 chkFileName = os.path.expandvars(os.path.expanduser(options.fileName))
57 refFileName = os.path.expandvars(os.path.expanduser(options.refFileName))
59 print (
"::: comparing configurations:")
60 print (
"::: ref: %s" % refFileName)
61 print (
"::: chk: %s" % chkFileName)
62 from AthenaCommon.ConfigurationShelve
import cmpConfigs
63 ref, chk, report = cmpConfigs (ref=refFileName,
66 print (
"::: all good")
69 for l
in report:
print (l)
70 print (
"::: configurations differ !")