|
2 | 2 | import shutil, sys |
3 | 3 | from types import SimpleNamespace as sn |
4 | 4 |
|
5 | | -paths = sn(root=Path(__file__).parent.parent) |
6 | | -paths.msgs = paths.root / 'utils' / 'data' / 'messages.json' |
7 | | -sys.path.insert(0, str(paths.root / 'src')) |
| 5 | +def main(): |
| 6 | + paths = sn(root=Path(__file__).parent.parent) |
| 7 | + paths.msgs = paths.root / 'utils' / 'data' / 'messages.json' |
| 8 | + sys.path.insert(0, str(paths.root / 'src')) |
8 | 9 |
|
9 | | -from translate_messages.lib import data, log # type: ignore |
| 10 | + from translate_messages.lib import data, log # type: ignore |
10 | 11 |
|
11 | | -msgs = sn(**{ key:val['message'] for key,val in data.json.read(paths.msgs)['clean'].items() }) |
| 12 | + msgs = sn(**{ key:val['message'] for key,val in data.json.read(paths.msgs)['clean'].items() }) |
12 | 13 |
|
13 | | -for target in ['dist', 'build', '*_cache', '__pycache__', '*.egg-info']: |
14 | | - for path in Path('.').rglob(target): |
15 | | - if path.is_dir() : shutil.rmtree(path) ; log.info(f'{msgs.log_REMOVED} {path}/') |
| 14 | + for target in ['dist', 'build', '*_cache', '__pycache__', '*.egg-info']: |
| 15 | + for path in Path('.').rglob(target): |
| 16 | + if path.is_dir() : shutil.rmtree(path) ; log.info(f'{msgs.log_REMOVED} {path}/') |
16 | 17 |
|
17 | | -log.success(f'{msgs.log_CLEAN_COMPLETE}!') |
| 18 | + log.success(f'{msgs.log_CLEAN_COMPLETE}!') |
| 19 | + |
| 20 | +if __name__ == '__main__' : main() |
0 commit comments