From 5b2870cc300ed0157bdf094d5e596edff6823d12 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Sat, 7 Sep 2019 18:25:42 -0500 Subject: [PATCH] Create pythonpath --- source/conf.py.example | 4 +++- source/zaz.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/source/conf.py.example b/source/conf.py.example index 06eda43..2057dc7 100644 --- a/source/conf.py.example +++ b/source/conf.py.example @@ -130,7 +130,8 @@ EXTENSION = { } -# If used more libraries set python path in True and copy inside +# ~ If used more libraries set python path in True and copy inside +# ~ If used easymacro pythonpath always is True DIRS = { 'meta': 'META-INF', 'source': 'source', @@ -154,6 +155,7 @@ FILES = { 'rdb': f'X{NAME}.rdb', 'update': f'{NAME.lower()}.update.xml', 'addin': 'CalcAddIn.xcu', + 'easymacro': True, } diff --git a/source/zaz.py b/source/zaz.py index 6b9a556..7a0999f 100644 --- a/source/zaz.py +++ b/source/zaz.py @@ -109,8 +109,8 @@ def _create_new_directories(): path = _join(path_source, DIRS['registration']) _mkdir(path) - if DIRS['pythonpath']: - path = _join(path_source, DIRS['pythonpath']) + if FILES['easymacro'] or DIRS['pythonpath']: + path = _join(path_source, 'pythonpath') _mkdir(path) path = DIRS['files'] @@ -137,6 +137,7 @@ def _create_new_files(): path = _join(path_source, FILES['py']) _save(path, DATA['py']) + msg = 'Created files...' log.info(msg) return @@ -208,6 +209,11 @@ def _update_files(): target = _join(path_source, DIRS['images'], f) copyfile(source, target) + if FILES['easymacro']: + source = 'easymacro.py' + target = _join(path_source, 'pythonpath', source) + copyfile(source, target) + path = _join(path_source, DIRS['meta'], FILES['manifest']) _save(path, DATA['manifest'])