diff options
author | ng0 <ng0@n0.is> | 2019-11-12 21:30:39 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-11-12 21:30:39 +0000 |
commit | ab19fc81090ebbbecf471b010bc41f5a43ec858f (patch) | |
tree | 32e94439fbec80a06326be18ed40b9256851014b /inc/fileproc.py | |
parent | 1fa59360a22db580a8b2b6a201d11eb545f7aa81 (diff) | |
download | www-ab19fc81090ebbbecf471b010bc41f5a43ec858f.tar.gz www-ab19fc81090ebbbecf471b010bc41f5a43ec858f.zip |
inc: more logic to remove code from Makefile. news/index.hmtl.j2: syntax.
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) |