예제 #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)