zrb 0.0.117__py3-none-any.whl → 0.0.119__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zrb/builtin/__init__.py +2 -2
- zrb/builtin/helper/__init__.py +0 -0
- zrb/builtin/helper/reccuring_action.py +46 -0
- zrb/builtin/schedule.py +12 -22
- zrb/builtin/watch_changes.py +31 -0
- zrb/helper/env_map/fetch.py +6 -6
- zrb/shell-scripts/notify.ps1 +16 -0
- zrb/task/base_remote_cmd_task.py +4 -1
- zrb/task/base_task/__init__.py +0 -0
- zrb/task/{base_task.py → base_task/base_task.py} +62 -201
- zrb/task/base_task/component/__init__.py +0 -0
- zrb/task/base_task/component/base_task_model.py +258 -0
- zrb/task/base_task/component/common_task_model.py +282 -0
- zrb/task/base_task/component/pid_model.py +17 -0
- zrb/task/base_task/component/renderer.py +119 -0
- zrb/task/base_task/component/trackers.py +76 -0
- zrb/task/checker.py +4 -1
- zrb/task/cmd_task.py +56 -36
- zrb/task/docker_compose_task.py +23 -19
- zrb/task/flow_task.py +1 -1
- zrb/task/notifier.py +157 -0
- zrb/task/recurring_task.py +20 -5
- zrb/task/resource_maker.py +1 -1
- zrb/task/task.py +1 -1
- zrb/task/time_watcher.py +2 -2
- zrb/task_env/env.py +26 -14
- zrb/task_env/env_file.py +15 -15
- zrb/task_input/base_input.py +2 -2
- {zrb-0.0.117.dist-info → zrb-0.0.119.dist-info}/METADATA +2 -2
- {zrb-0.0.117.dist-info → zrb-0.0.119.dist-info}/RECORD +33 -23
- zrb/builtin/watch.py +0 -44
- zrb/task/base_task_composite.py +0 -558
- {zrb-0.0.117.dist-info → zrb-0.0.119.dist-info}/LICENSE +0 -0
- {zrb-0.0.117.dist-info → zrb-0.0.119.dist-info}/WHEEL +0 -0
- {zrb-0.0.117.dist-info → zrb-0.0.119.dist-info}/entry_points.txt +0 -0
zrb/task/task.py
CHANGED
zrb/task/time_watcher.py
CHANGED
@@ -40,7 +40,7 @@ class TimeWatcher(Checker):
|
|
40
40
|
on_retry: Optional[OnRetry] = None,
|
41
41
|
on_failed: Optional[OnFailed] = None,
|
42
42
|
schedule: str = '',
|
43
|
-
checking_interval: Union[int, float] =
|
43
|
+
checking_interval: Union[int, float] = 1,
|
44
44
|
progress_interval: Union[int, float] = 30,
|
45
45
|
should_execute: Union[bool, str, Callable[..., bool]] = True
|
46
46
|
):
|
@@ -108,4 +108,4 @@ class TimeWatcher(Checker):
|
|
108
108
|
return False
|
109
109
|
|
110
110
|
def __repr__(self) -> str:
|
111
|
-
return f'<
|
111
|
+
return f'<TimeWatcher name={self._name}>'
|
zrb/task_env/env.py
CHANGED
@@ -19,10 +19,22 @@ class Env():
|
|
19
19
|
):
|
20
20
|
if name in RESERVED_ENV_NAMES:
|
21
21
|
raise ValueError(f'Forbidden input name: {name}')
|
22
|
-
self.
|
23
|
-
self.
|
24
|
-
self.
|
25
|
-
self.
|
22
|
+
self.__name: str = name
|
23
|
+
self.__os_name: str = os_name if os_name is not None else name
|
24
|
+
self.__default: str = default
|
25
|
+
self.__should_render: bool = should_render
|
26
|
+
|
27
|
+
def get_name(self) -> str:
|
28
|
+
return self.__name
|
29
|
+
|
30
|
+
def get_os_name(self) -> str:
|
31
|
+
return self.__os_name
|
32
|
+
|
33
|
+
def get_default(self) -> str:
|
34
|
+
return self.__default
|
35
|
+
|
36
|
+
def should_render(self) -> bool:
|
37
|
+
return self.__should_render
|
26
38
|
|
27
39
|
def get(self, prefix: str = '') -> str:
|
28
40
|
'''
|
@@ -41,22 +53,22 @@ class Env():
|
|
41
53
|
print(env.get('STAG')) # will show '0.0.0.0'
|
42
54
|
```
|
43
55
|
'''
|
44
|
-
if self.
|
45
|
-
return self.
|
46
|
-
prefixed_name = self.
|
56
|
+
if self.__os_name == '':
|
57
|
+
return self.__default
|
58
|
+
prefixed_name = self.__get_prefixed_name(self.__os_name, prefix)
|
47
59
|
if prefixed_name in os.environ and os.environ[prefixed_name] != '':
|
48
60
|
return os.environ[prefixed_name]
|
49
|
-
if self.
|
50
|
-
return os.environ[self.
|
51
|
-
return self.
|
61
|
+
if self.__os_name in os.environ and os.environ[self.__os_name] != '':
|
62
|
+
return os.environ[self.__os_name]
|
63
|
+
return self.__default
|
52
64
|
|
53
|
-
def
|
65
|
+
def __get_prefixed_name(self, name: str, prefix: str):
|
54
66
|
if prefix is None or prefix == '':
|
55
67
|
return name
|
56
68
|
return prefix + '_' + name
|
57
69
|
|
58
70
|
def __repr__(self) -> str:
|
59
|
-
name = self.
|
60
|
-
os_name = self.
|
61
|
-
default = self.
|
71
|
+
name = self.__name
|
72
|
+
os_name = self.__os_name
|
73
|
+
default = self.__default
|
62
74
|
return f'<Env name={name} os_name={os_name} default={default}>'
|
zrb/task_env/env_file.py
CHANGED
@@ -14,34 +14,34 @@ class EnvFile():
|
|
14
14
|
prefix: Optional[str] = None,
|
15
15
|
should_render: bool = False
|
16
16
|
):
|
17
|
-
self.
|
18
|
-
self.
|
19
|
-
self.
|
20
|
-
self.
|
21
|
-
self.
|
17
|
+
self.__env_file = env_file
|
18
|
+
self.__prefix = prefix.upper() if prefix is not None else None
|
19
|
+
self.__should_render = should_render
|
20
|
+
self.__env_list: List[Env] = []
|
21
|
+
self.__env_list_fetched: bool = False
|
22
22
|
|
23
23
|
def get_envs(self) -> List[Env]:
|
24
|
-
if self.
|
25
|
-
return self.
|
24
|
+
if self.__env_list_fetched:
|
25
|
+
return self.__env_list
|
26
26
|
env_list: List[Env] = []
|
27
|
-
env_map = dotenv_values(self.
|
27
|
+
env_map = dotenv_values(self.__env_file)
|
28
28
|
for key, value in env_map.items():
|
29
29
|
if key in RESERVED_ENV_NAMES:
|
30
30
|
continue
|
31
31
|
os_name: Optional[str] = None
|
32
|
-
if self.
|
33
|
-
os_name = f'{self.
|
32
|
+
if self.__prefix is not None and self.__prefix != '':
|
33
|
+
os_name = f'{self.__prefix}_{key}'
|
34
34
|
env_list.append(Env(
|
35
35
|
name=key,
|
36
36
|
os_name=os_name,
|
37
37
|
default=value,
|
38
|
-
should_render=self.
|
38
|
+
should_render=self.__should_render
|
39
39
|
))
|
40
|
-
self.
|
41
|
-
self.
|
40
|
+
self.__env_list = env_list
|
41
|
+
self.__env_list_fetched = True
|
42
42
|
return env_list
|
43
43
|
|
44
44
|
def __repr__(self) -> str:
|
45
|
-
env_file = self.
|
46
|
-
prefix = self.
|
45
|
+
env_file = self.__env_file
|
46
|
+
prefix = self.__prefix
|
47
47
|
return f'<EnvFile file={env_file} prefix={prefix}>'
|
zrb/task_input/base_input.py
CHANGED
@@ -52,7 +52,7 @@ class BaseInput(AnyInput):
|
|
52
52
|
self._show_choices = show_choices
|
53
53
|
self._show_envvar = show_envvar
|
54
54
|
self._nargs = nargs
|
55
|
-
self.
|
55
|
+
self.__should_render = should_render
|
56
56
|
|
57
57
|
def get_name(self) -> str:
|
58
58
|
return self._name
|
@@ -90,7 +90,7 @@ class BaseInput(AnyInput):
|
|
90
90
|
return options
|
91
91
|
|
92
92
|
def should_render(self) -> bool:
|
93
|
-
return self.
|
93
|
+
return self.__should_render
|
94
94
|
|
95
95
|
def is_hidden(self) -> bool:
|
96
96
|
return False
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: zrb
|
3
|
-
Version: 0.0.
|
4
|
-
Summary:
|
3
|
+
Version: 0.0.119
|
4
|
+
Summary: A Framework to Enhance Your Workflow
|
5
5
|
Author-email: Go Frendi Gunawan <gofrendiasgard@gmail.com>
|
6
6
|
Requires-Python: >=3.10.0
|
7
7
|
Description-Content-Type: text/markdown
|
@@ -4,7 +4,7 @@ zrb/advertisement.py,sha256=e-1tFPlmEuz8IqaIJ_9-2p9x5cuGsxssJGu5F0wHthI,505
|
|
4
4
|
zrb/runner.py,sha256=MPCNPMCyiYNZeubSxd1eM2Zr6PCIKF-9pkG385AXElw,118
|
5
5
|
zrb/action/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
zrb/action/runner.py,sha256=o16roJSug_c1D9IH2-trtPu1PeS83A3PfiJB2K_VzOs,4478
|
7
|
-
zrb/builtin/__init__.py,sha256
|
7
|
+
zrb/builtin/__init__.py,sha256=NwkM8HYaWHxr8sGE18gNF2qgf00FlhP2TWq1r1uDQAY,727
|
8
8
|
zrb/builtin/base64.py,sha256=nf_qWD2M0aX06zGef61U2nPdGHX_pfYN9E4gZmpBr5g,1346
|
9
9
|
zrb/builtin/env.py,sha256=hEjQios0i-3DantczxQnZnolzwZAGIQOE0Ygka330EU,1146
|
10
10
|
zrb/builtin/eval.py,sha256=FjAeWuD6KdvSKwsoUo8qbSO9qgc0rQVmRNib-XKOfVc,745
|
@@ -15,11 +15,11 @@ zrb/builtin/md5.py,sha256=IWN0uroXRiuyF0wD05BzGqAkMA3p6q9EbtWmJOPdOc0,1376
|
|
15
15
|
zrb/builtin/process.py,sha256=h7uMfEIqbOaNe8aTINZYYbHWw7mmUF8DkeiylPeWzSE,1281
|
16
16
|
zrb/builtin/project.py,sha256=XWz32OYBRox18fMe8xPrblPULytKDAd6O2E6aWw8PPI,1207
|
17
17
|
zrb/builtin/say.py,sha256=_NEAYZULtNg-WZvNXy0U_8T632Bbd2atJ1kjIu8-UHo,3973
|
18
|
-
zrb/builtin/schedule.py,sha256=
|
18
|
+
zrb/builtin/schedule.py,sha256=_i5LdDrRzeWayiGZVqftirnqMAf1Twd8WgKDd7ARpGk,1025
|
19
19
|
zrb/builtin/ubuntu.py,sha256=f1s2H8xK3xrb3X99RER9BvB8Wwx5wGxoxEJRhnumMm8,3042
|
20
20
|
zrb/builtin/update.py,sha256=JyLL_4AB__9viYKg5IP-s5kezLh37gyDqD0Fe42zIM8,396
|
21
21
|
zrb/builtin/version.py,sha256=i7NsuSl_MtyufEKrR42p0qHGVMpsPqkxZsewEHnM-QQ,492
|
22
|
-
zrb/builtin/
|
22
|
+
zrb/builtin/watch_changes.py,sha256=kH1TGgyP1EYwxKOoIQ4EdIOTuuVFUd9T2lVitE9ks3Y,850
|
23
23
|
zrb/builtin/devtool/__init__.py,sha256=fVBAYBSJgPoy_r_CGaY__1pQDca7ucrHxxfVUVHlU2o,568
|
24
24
|
zrb/builtin/devtool/devtool_install.py,sha256=WQ5JGVolriqbKZ6TYIVY-Yc08wkkPgDyI0Ixa8ehyqU,13270
|
25
25
|
zrb/builtin/devtool/aws/install.sh,sha256=C7jJP4LaB5lBehyNEUFaBtk1MmTvv6jdaP_lnXq0kao,1638
|
@@ -1089,6 +1089,8 @@ zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/Dock
|
|
1089
1089
|
zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/main.py,sha256=UpJoBSo4zNKFSa8-0pdJwCymjJDxVZicdoENshogtjE,447
|
1090
1090
|
zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/requirements.txt,sha256=HX56Al9bOoM8Mq1Yc44UE2cfT3XrTZGmHI6T3q7xn50,15
|
1091
1091
|
zrb/builtin/generator/simple_python_app/template/src/kebab-zrb-app-name/src/template.env,sha256=vtoZ0LV8OKAU1EUWBiB8PIKbf1FaNfm-49j7aXvKsgs,87
|
1092
|
+
zrb/builtin/helper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1093
|
+
zrb/builtin/helper/reccuring_action.py,sha256=Tojb_lk5qVjDyxfZjBvOw4vc_pVX5HhqFz9XJUH0dGA,1190
|
1092
1094
|
zrb/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1093
1095
|
zrb/config/config.py,sha256=emFGBfcbfg7N7N-Q6XBQlEaCiJpdRfhEgl3zmQ8gbuQ,1168
|
1094
1096
|
zrb/helper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -1120,7 +1122,7 @@ zrb/helper/codemod/format_code.py,sha256=ymxZtZm-5RuaddLUu8LJgguX0n8CJSbHb-McQDU
|
|
1120
1122
|
zrb/helper/docker_compose/fetch_external_env.py,sha256=pIXkMCXtDXVWdNPlpMolqdj4Q0Y73dhCeqwByCB6mWg,2042
|
1121
1123
|
zrb/helper/docker_compose/file.py,sha256=aBtQMV57TWtMO9AwsZ2OyBn16MhElZaDlq54zBqYBnA,685
|
1122
1124
|
zrb/helper/env_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1123
|
-
zrb/helper/env_map/fetch.py,sha256=
|
1125
|
+
zrb/helper/env_map/fetch.py,sha256=la0lgi6TOYBIEAuWRHTibfYgEm5Lj1bZ4Wznx3NGmX4,2209
|
1124
1126
|
zrb/helper/file/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1125
1127
|
zrb/helper/file/copy_tree.py,sha256=4kVqupzLYyF_neiRsedAFbxkeiK0VYsW45Z2zCkWLXA,1804
|
1126
1128
|
zrb/helper/file/text.py,sha256=_S1uYToMw3lcI95-op_kM_SWNJUyvYNc32XHIcokDWU,807
|
@@ -1140,37 +1142,45 @@ zrb/shell-scripts/_common-util.sh,sha256=6WPPOp_NBUgIMd1K2qlVZ6iYzZ-Xl3lUTzi4Rqr
|
|
1140
1142
|
zrb/shell-scripts/ensure-docker-is-installed.sh,sha256=CpfGjfoXFXoTWXsONIGZCMnmtFrk6ZamvO_8Fqp_WJ0,2893
|
1141
1143
|
zrb/shell-scripts/ensure-rsync-is-installed.sh,sha256=vHJWNEidemIrM2tQ17r5qwSUjz9hVKcjYbUEMo3pPJI,987
|
1142
1144
|
zrb/shell-scripts/ensure-ssh-is-installed.sh,sha256=TM0PLXT2vNfgv2ffcW_l-IqtMqHI1Z9nGdJvlToUlyM,2092
|
1145
|
+
zrb/shell-scripts/notify.ps1,sha256=6_xPoIwuxARpYljcjVV-iRJS3gJqGfx-B6kj719cJ9o,843
|
1143
1146
|
zrb/shell-scripts/rsync-util.sh,sha256=QzdhSBvUNMxB4U2B4m0Dxg9czGckRjB7Vk4A1ObG0-k,353
|
1144
1147
|
zrb/shell-scripts/ssh-util.sh,sha256=9lXDzw6oO8HuA4vdbfps_uQMMwKyNYX9fZkZgpK52g8,401
|
1145
1148
|
zrb/task/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1146
1149
|
zrb/task/any_task.py,sha256=2fD9_8ezytn4L37gyk9Qtawsmu60gGXBwuJVkYloqsw,6396
|
1147
1150
|
zrb/task/any_task_event_handler.py,sha256=vpO9t0fck8-oFu1KYptfcg2hXKRsk6V5je4Dg-Bl21o,359
|
1148
|
-
zrb/task/base_remote_cmd_task.py,sha256=
|
1149
|
-
zrb/task/
|
1150
|
-
zrb/task/
|
1151
|
-
zrb/task/checker.py,sha256=ukoxoaoGZ6kvZ-39wINVqVPUyOnkqBSLpFS7m2K7Fsg,3087
|
1152
|
-
zrb/task/cmd_task.py,sha256=JlYU3oR_gIUazgh-0xTdYjSfJ__KY9Rx2qC7qsuGGZU,13230
|
1151
|
+
zrb/task/base_remote_cmd_task.py,sha256=QgXkhHabvm5jqCCjjKHtjbG4snjvyyNG0Vw7oo9q3Bk,9028
|
1152
|
+
zrb/task/checker.py,sha256=IOPD6LZ_mZeSoNTzE335mXmeA7oobkkA4GxIDvLkL-I,3175
|
1153
|
+
zrb/task/cmd_task.py,sha256=RwhMQ24Mw6qbsOMDQwjbZ2YnlHI_8XfyMSVkRIkRi9g,13976
|
1153
1154
|
zrb/task/decorator.py,sha256=6mJuDhmyHnVwx8SzBf8el5KwYJdA06VTeb1BABgLmTc,2399
|
1154
|
-
zrb/task/docker_compose_task.py,sha256=
|
1155
|
-
zrb/task/flow_task.py,sha256=
|
1155
|
+
zrb/task/docker_compose_task.py,sha256=clbq1OOKC_zAz7IL3iBpNnCGR96JCF056r4o0v0E75k,13282
|
1156
|
+
zrb/task/flow_task.py,sha256=l0xCb6mlaaNK5NVZxhKWE1qKXUI2akzC6CZfciGh7P8,3939
|
1156
1157
|
zrb/task/http_checker.py,sha256=PoneoC9S7bTw41IP7hB9ewaWO-lF3ZWT75MXEPyThYA,5244
|
1158
|
+
zrb/task/notifier.py,sha256=UVhx1fLORhqyXprzqQqdoVYIFGrirwnTk-Ak18ZyucQ,5332
|
1157
1159
|
zrb/task/path_checker.py,sha256=BSBf8ZXEcTwVI3UskSgdXXWrCLWggnwk6sHHbEI0z5g,3382
|
1158
1160
|
zrb/task/path_watcher.py,sha256=9r36cMc7EaLehQVw0149TN-qOZitucR9mRW3S-w7SQw,4695
|
1159
1161
|
zrb/task/port_checker.py,sha256=IvOUhefkpYcKZJ9zGr0RNUZju5yLvXoNJlLlODpLZZ8,4111
|
1160
|
-
zrb/task/recurring_task.py,sha256=
|
1162
|
+
zrb/task/recurring_task.py,sha256=oBtuU5HXiCM6Nfsmb70kpebf7v_rVqpOYThwPCWGXOM,5091
|
1161
1163
|
zrb/task/remote_cmd_task.py,sha256=LYWmnZ4mPsU-RIdAUyhui7mlIunx4vY8upwjhctnkEs,3778
|
1162
|
-
zrb/task/resource_maker.py,sha256=
|
1164
|
+
zrb/task/resource_maker.py,sha256=2DiyR57srjO7lOzASH-gqHqbmJjtRppU4SG_H-evPqU,6522
|
1163
1165
|
zrb/task/rsync_task.py,sha256=3vxENH-unD1VLgZI09Ts_lAQRMi2i1UiJpsaI1dltzI,3966
|
1164
|
-
zrb/task/task.py,sha256=
|
1165
|
-
zrb/task/time_watcher.py,sha256=
|
1166
|
+
zrb/task/task.py,sha256=l1jzJil7AqnsFn9e8WyO-rgCIG1JSvB6DaRBQZQo00I,246
|
1167
|
+
zrb/task/time_watcher.py,sha256=cbmmKtbeMrkRwpRZi_-jyJ_hC4KnsOPHUIpzvns2hPQ,3728
|
1168
|
+
zrb/task/base_task/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1169
|
+
zrb/task/base_task/base_task.py,sha256=dVfXxYOSZHkePOGWrSrt94r1ZKh6b74z5jvAhZqcuf0,16104
|
1170
|
+
zrb/task/base_task/component/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1171
|
+
zrb/task/base_task/component/base_task_model.py,sha256=mi7v0ScvVlqkXSM6N0GUEWomVd3wwzL492LU60u2jZQ,9845
|
1172
|
+
zrb/task/base_task/component/common_task_model.py,sha256=9qwrnVARWafGm8PNpZtPmxlgVSD_3ZNt3hZxiOJO2m4,10478
|
1173
|
+
zrb/task/base_task/component/pid_model.py,sha256=pWCjgD3J2Jimjq1Y9pkVczZMeFEIcy7Hm9eFGrHGUZE,296
|
1174
|
+
zrb/task/base_task/component/renderer.py,sha256=RGq9UNOKi8sWSIOlxNrIlXgT8q-ia-pwKgRiCFrgVwU,4119
|
1175
|
+
zrb/task/base_task/component/trackers.py,sha256=3sPccnP7capEHdQ-ceRig04ee28kvo2an9I7x-Z5ZU8,1959
|
1166
1176
|
zrb/task_env/constant.py,sha256=JdPhtZCTZlbW-jzG5vyFtpEXgTJ-Yx863LcrX_LiURY,44
|
1167
|
-
zrb/task_env/env.py,sha256=
|
1168
|
-
zrb/task_env/env_file.py,sha256=
|
1177
|
+
zrb/task_env/env.py,sha256=599SOu3pG1dX5AOvYfubnzC92XZiFpEiq00-W1hJ8kQ,2256
|
1178
|
+
zrb/task_env/env_file.py,sha256=bbg75z8GdKEngmcRO9YNrhEWDlzzkzChdW23nynYhfs,1520
|
1169
1179
|
zrb/task_group/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1170
1180
|
zrb/task_group/group.py,sha256=qPZ79UZzLh5UPqsu2NflE6QAQzV568OPtXHcWloZX1o,1420
|
1171
1181
|
zrb/task_input/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1172
1182
|
zrb/task_input/any_input.py,sha256=k2c1kmW6W7gQsDqkIDgM5wlphEKjQvVmLqaDkphSVBM,582
|
1173
|
-
zrb/task_input/base_input.py,sha256=
|
1183
|
+
zrb/task_input/base_input.py,sha256=Za1_6ndOqo3SrGyw2nB3KgBcijsJtAkcmd2tFLhtR74,3298
|
1174
1184
|
zrb/task_input/bool_input.py,sha256=9CLQwB3_J1ANF5d7DCJ4aOCS5UMDMK6vn0y8iDwA1tw,1670
|
1175
1185
|
zrb/task_input/choice_input.py,sha256=HsnMWjzp_PezbSTEHS0yJ0wWj-Iz_dyTE4MYh_3Zysk,1748
|
1176
1186
|
zrb/task_input/constant.py,sha256=yvYY-Cc5eRAUQbe5aJcVVy846yyQYYg7v1hgiFyNikg,42
|
@@ -1179,8 +1189,8 @@ zrb/task_input/int_input.py,sha256=VYduGcAE0m7eDItRQboTFDCW5whMur_uH1Y9qtBIwV4,1
|
|
1179
1189
|
zrb/task_input/password_input.py,sha256=i6U-smP6zFo8Ts9x14YXVgx7PKkRWr4U_EzPFp9nucw,1687
|
1180
1190
|
zrb/task_input/str_input.py,sha256=w9TTUMlMQtlOXh2ahHPbRnFyTiV94lXizucCc8SuWoo,1668
|
1181
1191
|
zrb/task_input/task_input.py,sha256=HotqM1iYSzwE4PIj8grnEUsvJqjx1dS6Ek7i6ZJLq2Y,83
|
1182
|
-
zrb-0.0.
|
1183
|
-
zrb-0.0.
|
1184
|
-
zrb-0.0.
|
1185
|
-
zrb-0.0.
|
1186
|
-
zrb-0.0.
|
1192
|
+
zrb-0.0.119.dist-info/entry_points.txt,sha256=xTgXc1kBKYhJHEujdaSPHUcJT3-hbyP1mLgwkv-5sSk,40
|
1193
|
+
zrb-0.0.119.dist-info/LICENSE,sha256=WfnGCl8G60EYOPAEkuc8C9m9pdXWDe08NsKj3TBbxsM,728
|
1194
|
+
zrb-0.0.119.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
1195
|
+
zrb-0.0.119.dist-info/METADATA,sha256=DMV_f07FDRI-bO9zguDjmZxq3mN5kxOQzLBmNgVF3mQ,14176
|
1196
|
+
zrb-0.0.119.dist-info/RECORD,,
|
zrb/builtin/watch.py
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
from zrb.task.recurring_task import RecurringTask
|
2
|
-
from zrb.task.cmd_task import CmdTask
|
3
|
-
from zrb.task.path_watcher import PathWatcher
|
4
|
-
from zrb.task_input.str_input import StrInput
|
5
|
-
from zrb.runner import runner
|
6
|
-
|
7
|
-
|
8
|
-
watch = RecurringTask(
|
9
|
-
name='watch',
|
10
|
-
description='Watch changes and show message/run command',
|
11
|
-
inputs=[
|
12
|
-
StrInput(
|
13
|
-
name='pattern',
|
14
|
-
default='*.*',
|
15
|
-
prompt='File pattern',
|
16
|
-
description='File pattern to be watched'
|
17
|
-
),
|
18
|
-
],
|
19
|
-
triggers=[
|
20
|
-
PathWatcher(name='watch-path', path='{{input.pattern}}')
|
21
|
-
],
|
22
|
-
task=CmdTask(
|
23
|
-
name='run-task',
|
24
|
-
inputs=[
|
25
|
-
StrInput(
|
26
|
-
name='message',
|
27
|
-
default='👋',
|
28
|
-
prompt='Message to be shown',
|
29
|
-
description='Message to be shown when changes detected'
|
30
|
-
),
|
31
|
-
StrInput(
|
32
|
-
name='command',
|
33
|
-
default='',
|
34
|
-
prompt='Command to be executed',
|
35
|
-
description='Command to be executed when changes detected'
|
36
|
-
),
|
37
|
-
],
|
38
|
-
cmd=[
|
39
|
-
'{% if input.message != "" %}echo {{ input.message }}{% endif %}',
|
40
|
-
'{% if input.command != "" %}{{ input.command }}{% endif %}',
|
41
|
-
]
|
42
|
-
)
|
43
|
-
)
|
44
|
-
runner.register(watch)
|