aboutsummaryrefslogtreecommitdiffstats
path: root/qface/watch.py
diff options
context:
space:
mode:
authorJuergen Bocklage-Ryannel <juergen@ryannel.org>2018-11-22 13:10:34 +0100
committerJuergen Bocklage-Ryannel <juergen@ryannel.org>2018-11-22 13:10:34 +0100
commitffa5e14659ea6c7c7ffd25725089678c239a9155 (patch)
treeea4fe2f7dc94a12cd5159db8025bb1eb3b90df17 /qface/watch.py
parent2d6a4f42259cb137988538d5f2392d4602da1c9d (diff)
- add new qface binary to launch external rule files
- add ns to qtcpp/qtqml filters - restructured rules format, docs are now a list - changed monitor signature
Diffstat (limited to 'qface/watch.py')
-rw-r--r--qface/watch.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/qface/watch.py b/qface/watch.py
index e5d86ba..29bc30f 100644
--- a/qface/watch.py
+++ b/qface/watch.py
@@ -11,10 +11,9 @@ Provides an API to monitor the file system
class RunScriptChangeHandler(FileSystemEventHandler):
- def __init__(self, args, cwd):
+ def __init__(self, args):
super().__init__()
self.args = args
- self.cwd = cwd
self.is_running = False
def on_modified(self, event):
@@ -26,17 +25,17 @@ class RunScriptChangeHandler(FileSystemEventHandler):
if self.is_running:
return
self.is_running = True
- call(self.args, cwd=self.cwd)
+ call(self.args, cwd=Path.getcwd())
self.is_running = False
-def monitor(args, watch, cwd=Path.getcwd()):
+def monitor(args, watch):
"""
reloads the script given by argv when src files changes
"""
watch = watch if isinstance(watch, (list, tuple)) else [watch]
watch = [Path(entry).expand().abspath() for entry in watch]
- event_handler = RunScriptChangeHandler(args, cwd)
+ event_handler = RunScriptChangeHandler(args)
observer = Observer()
for entry in watch:
if entry.isfile():