Called by `handle_argv()`.
(self, all_)
| 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): |