ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/CMSSW/PhysicsTools/PythonAnalysis/scripts/edmProvDiff
(Generate patch)

Comparing CMSSW/PhysicsTools/PythonAnalysis/scripts/edmProvDiff (file contents):
Revision 1.1 by hegner, Wed Aug 12 12:08:24 2009 UTC vs.
Revision 1.2 by decosa, Wed Oct 7 13:28:42 2009 UTC

# Line 2 | Line 2
2  
3   # A script to compare the provenance of two input root files.
4   # It prints out informations about those modules which are common to the input files,
5 < # but whose parameters are set to different values, and about those modules
5 > # but whose parameters are setted to different values, and about those modules
6   # present only in one of the two files.
7   # According to the level of verbosity, it will be report the name of these modules
8   # and details about the parameters and their values.
# Line 12 | Line 12
12   from optparse import OptionParser
13   import sys
14   from subprocess import Popen, PIPE, STDOUT
15 < from PhysicsTools.PythonAnalysis.read_provenance import *
16 < from PhysicsTools.PythonAnalysis.diff_provenance import *
15 > from readProv import *
16 > from diffProv import *
17  
18  
19   usage = "usage: %prog  filename1 filename2"
# Line 21 | Line 21 | parser = OptionParser(usage=usage, versi
21   parser.add_option("-v", "--verbosity_level", dest="verbose", help="[0] to print short message [1], to print details about the differences of modules common to both files, [2] to print all the details about the differences between the two files")
22   (options, args) = parser.parse_args()
23  
24 # check whether all needed options are given
24   if len(args) != 2:
25 <    parser.print_help()
26 <    sys.exit()
28 <        
25 >    print 'Incorrect usage'
26 >
27   def provenance(args):
28      cmd="edmProvDump "+args    
29      if sys.platform == "linux2":
# Line 39 | Line 37 | def provenance(args):
37      file.write(provenance)
38  
39      return s
40 <
41 < prov1=provenance(args[0])
42 < prov2=provenance(args[1])
40 > try:
41 >    prov1=provenance(args[0])
42 >    prov2=provenance(args[1])
43 > except IndexError:
44 >    print "Specify input file names\nType 'edmProvDiff -h' to visualize the arguments needed"    
45   f=filereader()
46   module1=f.readfile(prov1)
47   module2=f.readfile(prov2)
48   d=difference(options.verbose)
49   d.module_diff(module1,module2,args[0],args[1])
50  
51 +                                                            

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines