Mercurial > libervia-web
comparison libervia/server/tasks/task.py @ 1509:106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 08 Apr 2023 13:44:11 +0200 |
parents | 822bd0139769 |
children |
comparison
equal
deleted
inserted
replaced
1508:ec3ad9abf9f9 | 1509:106bae41f5c8 |
---|---|
29 """Handle tasks of a Libervia site""" | 29 """Handle tasks of a Libervia site""" |
30 # can be "stop" or "continue" | 30 # can be "stop" or "continue" |
31 ON_ERROR: str = "stop" | 31 ON_ERROR: str = "stop" |
32 LOG_OUTPUT: bool = True | 32 LOG_OUTPUT: bool = True |
33 # list of directories to check for restarting this task | 33 # list of directories to check for restarting this task |
34 # Task.onDirEvent will be called if it exists, otherwise | 34 # Task.on_dir_event will be called if it exists, otherwise |
35 # the task will be run and Task.start will be called | 35 # the task will be run and Task.start will be called |
36 WATCH_DIRS: Optional[list] = None | 36 WATCH_DIRS: Optional[list] = None |
37 # list of task names which must be prepared/started before this one | 37 # list of task names which must be prepared/started before this one |
38 AFTER: Optional[list] = None | 38 AFTER: Optional[list] = None |
39 | 39 |
56 @property | 56 @property |
57 def build_path(self): | 57 def build_path(self): |
58 """path where generated files will be build for this site""" | 58 """path where generated files will be build for this site""" |
59 return self.manager.build_path | 59 return self.manager.build_path |
60 | 60 |
61 def getConfig(self, key, default=None, value_type=None): | 61 def config_get(self, key, default=None, value_type=None): |
62 return self.host.getConfig(self.resource, key=key, default=default, | 62 return self.host.config_get(self.resource, key=key, default=default, |
63 value_type=value_type) | 63 value_type=value_type) |
64 | 64 |
65 @property | 65 @property |
66 def site_name(self): | 66 def site_name(self): |
67 return self.resource.site_name | 67 return self.resource.site_name |
68 | 68 |
69 def findCommand(self, name, *args): | 69 def find_command(self, name, *args): |
70 """Find full path of a shell command | 70 """Find full path of a shell command |
71 | 71 |
72 @param name(unicode): name of the command to find | 72 @param name(unicode): name of the command to find |
73 @param *args(unicode): extra names the command may have | 73 @param *args(unicode): extra names the command may have |
74 @return (unicode): full path of the command | 74 @return (unicode): full path of the command |