diff options
Diffstat (limited to 'inc/fileproc.py')
-rw-r--r-- | inc/fileproc.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/inc/fileproc.py b/inc/fileproc.py index 435078bc..bf6cc8df 100644 --- a/inc/fileproc.py +++ b/inc/fileproc.py | |||
@@ -1,4 +1,17 @@ | |||
1 | from pathlib import Path | 1 | from pathlib import Path |
2 | import os | ||
3 | import shutil | ||
4 | |||
5 | def copy_tree(source, destination): | ||
6 | destination.mkdir(parents=True, exist_ok=True) | ||
7 | for _ in os.listdir(source): | ||
8 | i = source / _ | ||
9 | o = destination / _ | ||
10 | if i.is_dir(): | ||
11 | copy_tree(i, o) | ||
12 | else: | ||
13 | shutil.copy2(str(i), str(o)) | ||
14 | |||
2 | 15 | ||
3 | def copy_files(kind, conf, locale, inlist, ptarget): | 16 | def copy_files(kind, conf, locale, inlist, ptarget): |
4 | o = Path(ptarget) | 17 | o = Path(ptarget) |