Ejemplo n.º 1
0
def glob1(dirname, pattern):
    try:
        directories, files = default_storage.listdir(dirname)
        names = directories + files
    except NotImplementedError:
        return []
    if pattern[0] != '.':
        names = filter(lambda x: x[0] != '.', names)
    return fnmatch.filter(names, pattern)
Ejemplo n.º 2
0
def glob1(dirname, pattern):
    try:
        directories, files = default_storage.listdir(dirname)
        names = directories + files
    except Exception:
        # We are not sure that dirname is a real directory
        # and storage implementations are really exotic.
        return []
    if pattern[0] != '.':
        names = filter(lambda x: x[0] != '.', names)
    return fnmatch.filter(names, pattern)
Ejemplo n.º 3
0
def glob1(dirname, pattern):
    try:
        directories, files = default_storage.listdir(dirname)
        names = directories + files
    except Exception:
        # We are not sure that dirname is a real directory
        # and storage implementations are really exotic.
        return []
    if pattern[0] != '.':
        names = filter(lambda x: x[0] != '.', names)
    return fnmatch.filter(names, pattern)