MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / _argv_clean

Method _argv_clean

pipcl.py:1058–1075  ·  view source on GitHub ↗

Called by `handle_argv()`.

(self, all_)

Source from the content-addressed store, hash-verified

1056
1057
1058 def _argv_clean(self, all_):
1059 '''
1060 Called by `handle_argv()`.
1061 '''
1062 if not self.fn_clean:
1063 return
1064 paths = self.fn_clean(all_)
1065 if paths:
1066 if isinstance(paths, str):
1067 paths = paths,
1068 for path in paths:
1069 if not os.path.isabs(path):
1070 path = ps.path.join(self.root, path)
1071 path = os.path.abspath(path)
1072 assert path.startswith(self.root+os.sep), \
1073 f'path={path!r} does not start with root={self.root+os.sep!r}'
1074 log(f'Removing: {path}')
1075 shutil.rmtree(path, ignore_errors=True)
1076
1077
1078 def install(self, record_path=None, root=None):

Callers 1

handle_argvMethod · 0.95

Calls 1

logFunction · 0.70

Tested by

no test coverage detected