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)
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)
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)]
def _all_files_for_dir(dir): return [os.path.join(dir, path) for path in file_util.find(dir, followlinks=True)]