zrb 1.6.3__py3-none-any.whl → 1.6.5__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/config.py CHANGED
@@ -2,7 +2,6 @@ import importlib.metadata as metadata
2
2
  import logging
3
3
  import os
4
4
  import platform
5
- from textwrap import dedent
6
5
 
7
6
  from zrb.util.string.conversion import to_boolean
8
7
  from zrb.util.string.format import fstring_format
@@ -55,6 +54,14 @@ class Config:
55
54
  else []
56
55
  )
57
56
 
57
+ @property
58
+ def ROOT_GROUP_NAME(self) -> str:
59
+ return os.getenv("ZRB_ROOT_GROUP_NAME", "zrb")
60
+
61
+ @property
62
+ def ROOT_GROUP_DESCRIPTION(self) -> str:
63
+ return os.getenv("ZRB_ROOT_GROUP_DESCRIPTION", "Your Automation Powerhouse")
64
+
58
65
  @property
59
66
  def INIT_SCRIPTS(self) -> list[str]:
60
67
  init_scripts_str = os.getenv("ZRB_INIT_SCRIPTS", "")
zrb/input/text_input.py CHANGED
@@ -58,6 +58,14 @@ class TextInput(BaseInput):
58
58
  return " -->"
59
59
  return ""
60
60
 
61
+ @property
62
+ def editor_cmd(self) -> str | None:
63
+ if self._editor is not None:
64
+ return self._editor
65
+ if CFG.DEFAULT_EDITOR != "":
66
+ return CFG.DEFAULT_EDITOR
67
+ return None
68
+
61
69
  def to_html(self, shared_ctx: AnySharedContext) -> str:
62
70
  name = self.name
63
71
  description = self.description
@@ -71,6 +79,8 @@ class TextInput(BaseInput):
71
79
  )
72
80
 
73
81
  def _prompt_cli_str(self, shared_ctx: AnySharedContext) -> str:
82
+ if self.editor_cmd is None or self.editor_cmd.strip() == "":
83
+ return super()._prompt_cli_str(shared_ctx)
74
84
  prompt_message = super().prompt_message
75
85
  comment_prompt_message = (
76
86
  f"{self.comment_start}{prompt_message}{self.comment_end}"
@@ -86,11 +96,7 @@ class TextInput(BaseInput):
86
96
  if default_value:
87
97
  temp_file.write(default_value.encode())
88
98
  temp_file.flush()
89
- # Open the editor
90
- editor_cmd = (
91
- self._editor if self._editor is not None else CFG.DEFAULT_EDITOR
92
- )
93
- subprocess.call([editor_cmd, temp_file_name])
99
+ subprocess.call([self.editor_cmd, temp_file_name])
94
100
  # Read the edited content
95
101
  edited_content = read_file(temp_file_name)
96
102
  parts = [
zrb/runner/cli.py CHANGED
@@ -24,11 +24,20 @@ from zrb.util.string.conversion import double_quote
24
24
 
25
25
  class Cli(Group):
26
26
 
27
+ def __init__(self):
28
+ super().__init__(name="_zrb")
29
+
30
+ @property
31
+ def name(self):
32
+ return CFG.ROOT_GROUP_NAME
33
+
34
+ @property
35
+ def description(self):
36
+ return CFG.ROOT_GROUP_DESCRIPTION
37
+
27
38
  @property
28
39
  def banner(self) -> str:
29
- if self._banner is None:
30
- return CFG.BANNER
31
- return self._banner
40
+ return CFG.BANNER
32
41
 
33
42
  def run(self, args: list[str] = []):
34
43
  kwargs, args = self._extract_kwargs_from_args(args)
@@ -154,7 +163,7 @@ class Cli(Group):
154
163
  return kwargs, residual_args
155
164
 
156
165
 
157
- cli = Cli(name="zrb", description="Your Automation Powerhouse")
166
+ cli = Cli()
158
167
 
159
168
 
160
169
  @make_task(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zrb
3
- Version: 1.6.3
3
+ Version: 1.6.5
4
4
  Summary: Your Automation Powerhouse
5
5
  Home-page: https://github.com/state-alchemists/zrb
6
6
  License: AGPL-3.0-or-later
@@ -216,7 +216,7 @@ zrb/callback/callback.py,sha256=yPVsbMqRkFH5kKIcFVg-U0VEKTP2VXVArhgQYwD-Jv8,3293
216
216
  zrb/cmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
217
217
  zrb/cmd/cmd_result.py,sha256=L8bQJzWCpcYexIxHBNsXj2pT3BtLmWex0iJSMkvimOA,597
218
218
  zrb/cmd/cmd_val.py,sha256=7Doowyg6BK3ISSGBLt-PmlhzaEkBjWWm51cED6fAUOQ,1014
219
- zrb/config.py,sha256=JHP1Mq7N3skyFscFNF2fgqUIzHVyn6nxjFzYAgDOaT0,8252
219
+ zrb/config.py,sha256=15GX2HMyVnNz5QnkfeqnKN0ysNLTpmTWLDrG3vz5o0E,8477
220
220
  zrb/content_transformer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
221
221
  zrb/content_transformer/any_content_transformer.py,sha256=v8ZUbcix1GGeDQwB6OKX_1TjpY__ksxWVeqibwa_iZA,850
222
222
  zrb/content_transformer/content_transformer.py,sha256=STl77wW-I69QaGzCXjvkppngYFLufow8ybPLSyAvlHs,2404
@@ -244,10 +244,10 @@ zrb/input/int_input.py,sha256=UhxCFYlZdJcgUSGGEkz301zOgRVpK0KDG_IxxWpQfMU,1457
244
244
  zrb/input/option_input.py,sha256=TQB82ko5odgzkULEizBZi0e9TIHEbIgvdP0AR3RhA74,2135
245
245
  zrb/input/password_input.py,sha256=szBojWxSP9QJecgsgA87OIYwQrY2AQ3USIKdDZY6snU,1465
246
246
  zrb/input/str_input.py,sha256=NevZHX9rf1g8eMatPyy-kUX3DglrVAQpzvVpKAzf7bA,81
247
- zrb/input/text_input.py,sha256=NdceGgtbFFZkAoWOBW4xarjM-N1oePTStBJb8RbOqLw,3499
247
+ zrb/input/text_input.py,sha256=6T3MngWdUs0u0ZVs5Dl11w5KS7nN1RkgrIR_zKumzPM,3695
248
248
  zrb/llm_config.py,sha256=TAGha1PAiS-vvxM3UyAlIK_0mh3qe5clOfRKbQhGUF8,9477
249
249
  zrb/runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
250
- zrb/runner/cli.py,sha256=Fh1p5qwa8sK2IlHbPoBHWLBA7rplDMlQpZfmbMq6gy8,6835
250
+ zrb/runner/cli.py,sha256=QDsK98t9dXoaG8A7XFwxFg5jjYaiCyimwThc5zhZ4Vo,6935
251
251
  zrb/runner/common_util.py,sha256=JDMcwvQ8cxnv9kQrAoKVLA40Q1omfv-u5_d5MvvwHeE,1373
252
252
  zrb/runner/web_app.py,sha256=huY9SCvMC9akhEQDW6mUC0osr0b0H3EosD7GFClVt-A,2612
253
253
  zrb/runner/web_config/config.py,sha256=0wR58KreAmawGGfamm0GLZY344HaXs7qfDgHLavBDwo,3125
@@ -369,7 +369,7 @@ zrb/util/string/name.py,sha256=SXEfxJ1-tDOzHqmSV8kvepRVyMqs2XdV_vyoh_9XUu0,1584
369
369
  zrb/util/todo.py,sha256=VGISej2KQZERpornK-8X7bysp4JydMrMUTnG8B0-liI,20708
370
370
  zrb/xcom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
371
371
  zrb/xcom/xcom.py,sha256=o79rxR9wphnShrcIushA0Qt71d_p3ZTxjNf7x9hJB78,1571
372
- zrb-1.6.3.dist-info/METADATA,sha256=lq9Tb957J2-bL_K26uJ7xdoD1xnpBksE1rL1Jo9RQc8,8385
373
- zrb-1.6.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
374
- zrb-1.6.3.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
375
- zrb-1.6.3.dist-info/RECORD,,
372
+ zrb-1.6.5.dist-info/METADATA,sha256=latmSfH5rGkN1XC7-Dw0guVWBExeQH8QcSjrzsJBsGw,8385
373
+ zrb-1.6.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
374
+ zrb-1.6.5.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
375
+ zrb-1.6.5.dist-info/RECORD,,
File without changes