15 __author__ =
"Sebastien Binet"
20 from optparse
import OptionParser
22 if __name__ ==
"__main__":
24 parser = OptionParser(usage=
"usage: %prog [options] [-r] file1.pool [-f] file2.pool")
25 parser.add_option(
"-r",
28 help =
"The path to the first POOL file to analyze" )
29 parser.add_option(
"-f",
32 help =
"The path to the second POOL file to analyze" )
33 parser.add_option(
"-v",
35 action =
"store_true",
38 help =
"Switch to activate verbose printout" )
39 parser.add_option(
"-s",
41 action =
"store_true",
44 help =
"Compare both memSize and diskSize" )
47 (options, args) = parser.parse_args()
49 if len(args) > 0
and args[0][0] !=
"-":
50 options.refFileName = args[0]
52 if len(args) > 1
and args[1][0] !=
"-":
53 options.fileName = args[1]
56 if options.fileName
is None or options.refFileName
is None :
57 str(parser.print_help()
or "")
61 chkFileName = os.path.expandvars(os.path.expanduser(options.fileName))
62 refFileName = os.path.expandvars(os.path.expanduser(options.refFileName))
64 import PyUtils.PoolFile
as PF
65 diff = PF.DiffFiles( refFileName = refFileName,
66 chkFileName = chkFileName,
67 verbose = options.verbose,
68 strict = options.strict )
71 sys.exit(diff.status())