nappy/utils/compare.py
def compFiles(f1, f2):
    """
    Compares contents of two files.
    """	
    name = os.path.split(f1)[-1]
    # Ignore anything that is in exclusion list
    for excl in file_exclusions:
        if excl.match(name):
            print( "IGNORING EXCLUDED file:", f1)
            return

    # Check they exist
    for f in (f1, f2):
        if not os.path.isfile(f):
            exitNicely("CANNOT compare files as item does not exist:" + f)
            

    with open(f1) as fh1:
        l1 = fh1.readlines()

    with open(f2) as fh2:
        l2 = fh2.readlines()

    leng = len(l1)
    if len(l2) < leng: 
        leng=len(l2)

    print( "\n>>>", f1, "\n<<<", f2)

    for i in range(leng):
        if l1[i] != l2[i]:
            print( "Line %s:" % (i+1))
            print( ">>>", l1[i])
            print( "<<<", l2[i])

    Compares contents of two files.
    
Compares contents of two files.
Compares contents of two files .
def compFiles(f1, f2):
    name = os.path.split(f1)[-1]
    for excl in file_exclusions:
        if excl.match(name):
            print( "IGNORING EXCLUDED file:", f1)
            return
    for f in (f1, f2):
        if not os.path.isfile(f):
            exitNicely("CANNOT compare files as item does not exist:" + f)
    with open(f1) as fh1:
        l1 = fh1.readlines()
    with open(f2) as fh2:
        l2 = fh2.readlines()
    leng = len(l1)
    if len(l2) < leng: 
        leng=len(l2)
    print( "\n>>>", f1, "\n<<<", f2)
    for i in range(leng):
        if l1[i] != l2[i]:
            print( "Line %s:" % (i+1))
            print( ">>>", l1[i])
            print( "<<<", l2[i])
def compFiles ( f1 , f2 ) : name = os . path . split ( f1 ) [ - 1 ] for excl in file_exclusions : if excl . match ( name ) : print ( "IGNORING EXCLUDED file:" , f1 ) return for f in ( f1 , f2 ) : if not os . path . isfile ( f ) : exitNicely ( "CANNOT compare files as item does not exist:" + f ) with open ( f1 ) as fh1 : l1 = fh1 . readlines ( ) with open ( f2 ) as fh2 : l2 = fh2 . readlines ( ) leng = len ( l1 ) if len ( l2 ) < leng : leng = len ( l2 ) print ( "\n>>>" , f1 , "\n<<<" , f2 ) for i in range ( leng ) : if l1 [ i ] != l2 [ i ] : print ( "Line %s:" % ( i + 1 ) ) print ( ">>>" , l1 [ i ] ) print ( "<<<" , l2 [ i ] )
Compares contents of two files.
Compares contents of two files .
"""
    Compares contents of two files.
    """ # Ignore anything that is in exclusion list # Check they exist
f1
f2