コード例 #1
0
def find(root, followlinks=False, includedirs=False):
    paths = file_util.find(root, followlinks, includedirs)
    if not paths:
        print("<empty>")
    else:
        for path in paths:
            print(path)
コード例 #2
0
def find(root, followlinks=False, includedirs=False, ignore=None):
    paths = file_util.find(root, followlinks, includedirs)
    if ignore:
        paths = _filter_ignored(paths, ignore)
    _sort_normalized_paths(paths)
    if not paths:
        print("<empty>")
    else:
        for path in paths:
            print(path)
コード例 #3
0
    def ls(self,
           run=None,
           all=False,
           sourcecode=False,
           ignore_compiled_source=False):
        # TODO: remove ignore_compiled_source for op2 promo
        if not run:
            runs = self.list_runs()
            if not runs:
                raise RuntimeError("no runs")
            run = runs[0]

        def filter(path):
            default_select = (all or not path.startswith(".guild")
                              or (sourcecode and _is_run_sourcecode(path)))
            return default_select and not (ignore_compiled_source
                                           and _is_compiled_source(path))

        return [path for path in file_util.find(run.path) if filter(path)]
コード例 #4
0
def _all_files_for_dir(dir):
    return [os.path.join(dir, path) for path in file_util.find(dir, followlinks=True)]