Changeset 3468 for nappy/trunk


Ignore:
Timestamp:
20/02/08 14:00:02 (12 years ago)
Author:
astephen
Message:

Fixed a few bugs and improved return check whether really same or not.

Location:
nappy/trunk/nappy/utils
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nappy/trunk/nappy/utils/compare.py

    r3466 r3468  
    22 
    33""" 
    4 ompare.py 
    5 ========= 
     4compare.py 
     5========== 
    66 
    77Tool to compare contents of files or directories full of files. 
  • nappy/trunk/nappy/utils/compare_na.py

    r3466 r3468  
    4444 
    4545 
     46def exitNicely(msg): 
     47    "Tidy exit." 
     48    print __doc__ 
     49    print msg 
     50    sys.exit() 
     51 
     52 
    4653def compareNA(i1, i2, **kwargs): 
    4754    """ 
     
    6774    if len(l2) < leng: 
    6875        leng = len(l2) 
     76 
     77    all_same = True 
    6978 
    7079    for i in range(leng): 
     
    92101               
    93102        if same == False: 
     103            all_same = False 
    94104            print "Line %s:" % (i+1) 
    95105            print ">>>", l1[i] 
    96106            print "<<<", l2[i] 
    97107 
    98     return same 
     108    return all_same 
    99109 
    100110 
     
    133143    body2 = l2[head_len2:] 
    134144 
    135  
     145    same = True 
    136146    if header == True: 
    137147        print "Comparing headers:" 
     
    154164            print "Body lengths differ:\n>>> %s: %s\n<<< %s: %s" % (f1, len(body1), f2, len(body2)) 
    155165        
     166    return same 
    156167 
    157168 
Note: See TracChangeset for help on using the changeset viewer.