dbrtools/dbr/diffenv.py
changeset 208 01c2b1268053
parent 203 e274d29c8bc9
child 242 9fd4819bf104
equal deleted inserted replaced
206:2fd92922bf5c 208:01c2b1268053
    15 
    15 
    16 import dbrenv
    16 import dbrenv
    17 
    17 
    18 def run(args):
    18 def run(args):
    19     if(len(args)):
    19     if(len(args)):
       
    20       filtertype = ''
    20       if(len(args) == 1):
    21       if(len(args) == 1):
    21         first = '/'
    22         first = '/'
    22         second = args[0]
    23         second = args[0]
    23       else:
    24       else:
    24         first = args[0]
    25         first = args[0]
    25         second = args[1]    
    26         second = args[1]
       
    27       if(len(args) == 3):
       
    28         filtertype = args[2]    
    26       db1=dbrenv.CreateDB(first)
    29       db1=dbrenv.CreateDB(first)
    27       db2=dbrenv.CreateDB(second)
    30       db2=dbrenv.CreateDB(second)
    28       results = db1.compare(db2)
    31       results = db1.compare(db2)
    29       results.printdetail()
    32       filter = dbrenv.CreateFilter(filtertype)
    30       results.printsummary()
    33       filteredresults = filter.filter(results)
       
    34       filteredresults.printdetail()
       
    35       filteredresults.printsummary()
    31     else:
    36     else:
    32       help()
    37       help()
    33       
    38       
    34 def help():
    39 def help():
    35   print "Compares two environments"
    40   print "Compares two environments"