comparison libervia/server/tasks/manager.py @ 1364:df40708c4c76

server: renamed `--dev_mode` to `--dev-mode` and set it as a flag: good practice is to use a dash instead of underscode for CLI arguments. This options is actually a flag, no need to specify the value.
author Goffi <goffi@goffi.org>
date Fri, 20 Nov 2020 17:53:01 +0100
parents a46d0e0f383b
children 822bd0139769
comparison
equal deleted inserted replaced
1363:c3dac1e11341 1364:df40708c4c76
125 log.debug(f"Skipping {task_name} which cancelled itself: {e}") 125 log.debug(f"Skipping {task_name} which cancelled itself: {e}")
126 return 126 return
127 127
128 self.tasks[task_name] = task 128 self.tasks[task_name] = task
129 self.validateData(task) 129 self.validateData(task)
130 if self.host.options['dev_mode']: 130 if self.host.options['dev-mode']:
131 dirs = task.WATCH_DIRS or [] 131 dirs = task.WATCH_DIRS or []
132 for dir_ in dirs: 132 for dir_ in dirs:
133 self.host.files_watcher.watchDir( 133 self.host.files_watcher.watchDir(
134 dir_, auto_add=True, recursive=True, 134 dir_, auto_add=True, recursive=True,
135 callback=self._autorunTask, task_name=task_name) 135 callback=self._autorunTask, task_name=task_name)