def ParentSearch(pFilePath, pDefaultPath, pJoin='\\'):
    '''
    Scan parent list for file selecting lowest level matching file
    '''
    lParts = pFilePath.split(pJoin)
    lCount = len(lParts) - 1
    lPath = ''
    while lCount > 0:
        lPath = pJoin.join(lParts[0:lCount]) + pJoin + lParts[-1]
        if os.path.exists(lPath):
            break
        lCount -= 1
    else:
        lPath = pDefaultPath
    return lPath

    Scan parent list for file selecting lowest level matching file
    
recipes/Python/577440_extensiDopy__Win32/recipe-577440.py