aboutsummaryrefslogtreecommitdiffstats
path: root/cli.py
diff options
context:
space:
mode:
authorJuergen Ryannel <juergen.bocklage-ryannel@pelagicore.com>2016-12-06 17:04:41 +0100
committerJuergen Ryannel <juergen.bocklage-ryannel@pelagicore.com>2016-12-06 17:04:41 +0100
commit13821eea8cd0ef58fb6b066c15bb7add4e62aca5 (patch)
tree502544caf8761e5e63af63917822808375ed4a6c /cli.py
parent8931360982145a18225e5815d7d543ab1406eeba (diff)
fixed some path issues, when reloading from different directory
Diffstat (limited to 'cli.py')
-rwxr-xr-xcli.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/cli.py b/cli.py
index bb0a882..c70ecf3 100755
--- a/cli.py
+++ b/cli.py
@@ -13,8 +13,9 @@ import yaml
import logging
import logging.config
-# logging.config.dictConfig(yaml.load(open('log.yaml')))
-logging.basicConfig()
+here = os.path.dirname(__file__)
+
+logging.config.dictConfig(yaml.load(open(os.path.join(here, 'log.yaml'))))
logger = logging.getLogger(__name__)
@@ -143,15 +144,22 @@ def _generate_once(generator, input, output):
def _generate_reload(generator, input, output):
"""run the named generator and monitor the input and generator folder"""
+ input = [Path(entry).expand().abspath() for entry in input]
+ output = Path(output).expand().abspath()
in_option = ' '.join(input)
script = 'python3 {0} {1} {2}'.format(generator, in_option, output)
event_handler = RunScriptChangeHandler(script)
event_handler.run() # run always once
observer = Observer()
- observer.schedule(event_handler, generator.dirname().abspath(), recursive=True)
+ path = generator.dirname().expand().abspath()
+ print('watch:', path)
+ observer.schedule(event_handler, path, recursive=True)
for entry in input:
- observer.schedule(event_handler, Path(entry).abspath(), recursive=True)
- observer.schedule(event_handler, './qface', recursive=True)
+ print('watch:', entry)
+ observer.schedule(event_handler, entry, recursive=True)
+ path = Path(__file__).parent / 'qface'
+ print('watch:', path)
+ observer.schedule(event_handler, path, recursive=True)
observer.start()
try: