def main(args): """diff two POOL files (containers and sizes)""" import os.path as osp old = osp.expandvars(osp.expanduser(args.old)) new = osp.expandvars(osp.expanduser(args.new)) import PyUtils.PoolFile as PF diff = PF.DiffFiles(refFileName=old, chkFileName=new, verbose=args.verbose) diff.printSummary() return diff.status()
def diff_pool(self, file_name, ref_file): """TBD.""" import PyUtils.PoolFile as PF # diff-pool df = PF.DiffFiles(refFileName=ref_file, chkFileName=file_name, ignoreList=['RecoTimingObj_p1_RAWtoESD_timings', 'RecoTimingObj_p1_ESDtoAOD_timings']) df.printSummary() stat = df.status() print stat del df return stat
def diffPoolFiles(ref, chk, details, toIgnore=[ 'RecoTimingObj_p1_RAWtoESD_timings', 'RecoTimingObj_p1_ESDtoAOD_timings' ]): import PyUtils.PoolFile as PF try: df = PF.DiffFiles(refFileName=ref, chkFileName=chk, ignoreList=toIgnore) if details is None: df.printSummary() else: df.printSummary(details) stat = df.status() del df except: print("Exception caught while diff'ing POOL files") stat = True return stat
action="store_true", dest="strict", default=False, help="Compare both memSize and diskSize") (options, args) = parser.parse_args() if len(args) > 0 and args[0][0] != "-": options.refFileName = args[0] pass if len(args) > 1 and args[1][0] != "-": options.fileName = args[1] pass if options.fileName is None or options.refFileName is None: str(parser.print_help() or "") sys.exit(1) pass chkFileName = os.path.expandvars(os.path.expanduser(options.fileName)) refFileName = os.path.expandvars(os.path.expanduser(options.refFileName)) import PyUtils.PoolFile as PF diff = PF.DiffFiles(refFileName=refFileName, chkFileName=chkFileName, verbose=options.verbose, strict=options.strict) diff.printSummary() sys.exit(diff.status())