__revision__ = "$Id: __init__.py,v 1.3 2001/06/07 08:28:00 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_query_adapter_simple']
    for file in ignored_files:
        if file in files:
            files.remove(file)

    files.sort(CompareFiles)

    return (dirs, files)


g_indexes = {'test_global_cache':0,
             'test_storage_manager':1,
             'test_persistent_object':3,
             'test_collection':4,
             'test_module':5,
             'test_interface_creation':6,
             }

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