__revision__ = "$Id: __init__.py,v 1.2 2001/06/07 08:27:56 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 = ['TestIterator','test_collection_util']
    for file in ignored_files:
        if file in files:
            files.remove(file)

    files.sort(CompareFiles)

    return (dirs, files)


g_indexes = {'test_collection_base':0,
             'test_all_collections':1,
             'test_dictionary_base':2,
             'test_all_dictionaries':4,
             }

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