Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
Order paths by matching file extensions or return everything

        def select_extensions(paths, extensions):
    'Order paths by matching file extensions or return everything'
    pathsByExtension = defaultdict(list)
    for path in paths:
        extension = os.path.splitext(path)[1].lower()
        pathsByExtension[extension].append(path)
    selectedPaths = []
    for extension in extensions:
        selectedPaths.extend(sorted(pathsByExtension[extension.lower()]))
    return selectedPaths or paths
        


src/a/r/archiveIO-0.4.4/archiveIO/tests.py   archiveIO(Download)
from unittest import TestCase
 
from archiveIO import Archive, ArchiveError, save, load, select_extensions, walk_paths, EXTENSION_PACKS