示例#1
0
def collect_files(args):
    collected = []
    for f in args:
        if os.path.isfile(f):
            if Sampler.is_filetype_supported(f):
                collected.append(f)
        elif os.path.isdir(f):
            collected.extend(collect_dir(f))
        else:
            raise IOError("File not found: " + repr(f))
    return collected
示例#2
0
文件: put.py 项目: svanzoest/aksy
def collect_files(args):
    collected = []
    for f in args:
        if os.path.isfile(f):
            if Sampler.is_filetype_supported(f):
                collected.append(f)
        elif os.path.isdir(f):
            collected.extend(collect_dir(f))
        else:
            raise IOError("File not found: " + repr(f))
    return collected
示例#3
0
def collect_dir(args):
    for root, dir, files in os.walk(args):
        for found in files:
            if Sampler.is_filetype_supported(found):
                yield os.path.join(root, found)
示例#4
0
文件: put.py 项目: svanzoest/aksy
def collect_dir(args):
    for root, dir, files in os.walk(args):
        for found in files:
            if Sampler.is_filetype_supported(found):
                yield os.path.join(root, found)