__revision__ = "$Id: __init__.py,v 1.4 2001/06/08 15:49:48 molson Exp $"


def PreprocessFiles(tester, dirs, files):
    """
    PreprocessFiles(tester, dirs, files) -> (dirs, files)
    
    This function is responsible for sorting and trimming the
    file and directory lists as needed for proper testing.
    """

    ignored_files = ['test_util','nested_definitions','operation_defs']
    
    for file in ignored_files:
        if file in files:
            files.remove(file)

    files.sort(CompareFiles)

    return (dirs, files)


g_indexes = {'objects':0,
             'binding':1,
             'all_types':2,
             'collections':3,
             }

def CompareFiles(left,right):
    l = g_indexes.get(left,10)
    r = g_indexes.get(right,10)
    return cmp(l,r)
