peerdrive/client/views/diff3.py
def find_match(list1, list2, nr1, nr2, mincount=3):
    """searches next matching pattern with lenght mincount
       if no pattern is found len of the both lists is returned
    """
    len1 = len(list1)
    len2 = len(list2)
    hit1 = None
    hit2 = None
    idx1 = nr1
    idx2 = nr2

    while ((idx1 < len1) or (idx2 < len2)):
        i =  nr1
        while i <= idx1:
            hit_count = match(list1, list2, i, idx2, mincount)
            if hit_count >= mincount:
                hit1 = (i, idx2)
                break
            i = i + 1

        i = nr2
        while i < idx2:
            hit_count = match(list1, list2, idx1, i, mincount)
            if hit_count >= mincount:
                hit2 = (idx1, i)
                break
            i = i + 1

        if hit1 or hit2: break
        if idx1 < len1: idx1 = idx1 + 1
        if idx2 < len2: idx2 = idx2 + 1

    if hit1 and hit2:
        #XXXX which one?
        return hit1
    elif hit1: return hit1
    elif hit2: return hit2
    else: return (len1, len2)
searches next matching pattern with lenght mincount
       if no pattern is found len of the both lists is returned
    
searches next matching pattern with lenght mincount
if no pattern is found len of the both lists is returned
searches next matching pattern with lenght mincount if no pattern is found len of the both lists is returned
def find_match(list1, list2, nr1, nr2, mincount=3):
    len1 = len(list1)
    len2 = len(list2)
    hit1 = None
    hit2 = None
    idx1 = nr1
    idx2 = nr2
    while ((idx1 < len1) or (idx2 < len2)):
        i =  nr1
        while i <= idx1:
            hit_count = match(list1, list2, i, idx2, mincount)
            if hit_count >= mincount:
                hit1 = (i, idx2)
                break
            i = i + 1
        i = nr2
        while i < idx2:
            hit_count = match(list1, list2, idx1, i, mincount)
            if hit_count >= mincount:
                hit2 = (idx1, i)
                break
            i = i + 1
        if hit1 or hit2: break
        if idx1 < len1: idx1 = idx1 + 1
        if idx2 < len2: idx2 = idx2 + 1
    if hit1 and hit2:
        return hit1
    elif hit1: return hit1
    elif hit2: return hit2
    else: return (len1, len2)
def find_match ( list1 , list2 , nr1 , nr2 , mincount = 3 ) : len1 = len ( list1 ) len2 = len ( list2 ) hit1 = None hit2 = None idx1 = nr1 idx2 = nr2 while ( ( idx1 < len1 ) or ( idx2 < len2 ) ) : i = nr1 while i <= idx1 : hit_count = match ( list1 , list2 , i , idx2 , mincount ) if hit_count >= mincount : hit1 = ( i , idx2 ) break i = i + 1 i = nr2 while i < idx2 : hit_count = match ( list1 , list2 , idx1 , i , mincount ) if hit_count >= mincount : hit2 = ( idx1 , i ) break i = i + 1 if hit1 or hit2 : break if idx1 < len1 : idx1 = idx1 + 1 if idx2 < len2 : idx2 = idx2 + 1 if hit1 and hit2 : return hit1 elif hit1 : return hit1 elif hit2 : return hit2 else : return ( len1 , len2 )
searches next matching pattern with lenght mincount
if no pattern is found len of the both lists is returned
searches next matching pattern with lenght mincount if no pattern is found len of the both lists is returned
"""searches next matching pattern with lenght mincount
       if no pattern is found len of the both lists is returned
    """ #XXXX which one?
list1
list2
nr1
nr2
mincount