コード例 #1
0
def _walk(path):
    raise_if_aborted()
    dirs, files = xbmcvfs.listdir(path)
    # xbmcvfs bug: sometimes return invalid utf-8 encoding. we only care about
    # finding changed paths so it's ok to ignore here.
    dirs = [path + _.decode('utf-8', 'ignore') for _ in dirs if not hidden(_)]
    files = [path + _.decode('utf-8', 'ignore') for _ in files if not hidden(_)]
    yield dirs, files
    for d in dirs:
        for dirs, files in _walk(d + '/'):
            yield dirs, files
コード例 #2
0
def _walk(path):
    path = encode_path(path)
    for root, dirs, files in os.walk(path):
        raise_if_aborted()
        if dirs or files:
            for d in dirs:
                if hidden(d):
                    dirs.remove(d)
            dirs = (decode_path(os.path.join(root, d)) for d in dirs)
            files = (decode_path(os.path.join(root, f)) for f in files if not hidden(f))
            yield dirs, files
コード例 #3
0
def _walk(path):
    raise_if_aborted()
    dirs, files = xbmcvfs.listdir(path)
    # xbmcvfs bug: sometimes return invalid utf-8 encoding. we only care about
    # finding changed paths so it's ok to ignore here.
    dirs = [path + _.decode('utf-8', 'ignore') for _ in dirs if not hidden(_)]
    files = [
        path + _.decode('utf-8', 'ignore') for _ in files if not hidden(_)
    ]
    yield dirs, files
    for d in dirs:
        for dirs, files in _walk(d + '/'):
            yield dirs, files
コード例 #4
0
def _list_files(path):
    dirs, files = xbmcvfs.listdir(path)
    return [path + '/' + f.decode('utf-8', 'ignore') for f in files if not hidden(f)]
コード例 #5
0
def _list_files(path):
    dirs, files = xbmcvfs.listdir(path)
    return [
        path + '/' + f.decode('utf-8', 'ignore') for f in files
        if not hidden(f)
    ]
コード例 #6
0
def _list_files(root):
    root = encode_path(root)
    paths = [os.path.join(root, name) for name in os.listdir(root) if not hidden(name)]
    return [decode_path(path) for path in paths if not os.path.isdir(path)]