zrb 1.6.2__py3-none-any.whl → 1.6.4__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
@@ -154,7 +154,7 @@ class Cli(Group):
154
154
  return kwargs, residual_args
155
155
 
156
156
 
157
- cli = Cli(name="zrb", description="Your Automation Powerhouse")
157
+ cli = Cli(name=CFG.ROOT_GROUP_NAME, description=CFG.ROOT_GROUP_DESCRIPTION)
158
158
 
159
159
 
160
160
  @make_task(
zrb/util/cmd/command.py CHANGED
@@ -71,9 +71,8 @@ async def run_command(
71
71
  line = None
72
72
  try:
73
73
  line = await stream.readline()
74
- line = line.decode("utf-8").rstrip()
75
74
  except asyncio.exceptions.CancelledError:
76
- break
75
+ pass
77
76
  except asyncio.exceptions.LimitOverrunError as e:
78
77
  # Recover by reading a limited chunk instead
79
78
  await stream.read(e.consumed)
@@ -83,6 +82,10 @@ async def run_command(
83
82
  pass
84
83
  if not line:
85
84
  break
85
+ try:
86
+ line = line.decode("utf-8").rstrip()
87
+ except Exception:
88
+ pass
86
89
  lines.append(line)
87
90
  if len(lines) > max_lines:
88
91
  lines.pop(0) # Keep only the last max_lines
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zrb
3
- Version: 1.6.2
3
+ Version: 1.6.4
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=AnMGS1sVRXyAc4dIjDanNrTOk5JQXU45xz8nC7oUZX0,6847
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
@@ -343,7 +343,7 @@ zrb/util/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
343
343
  zrb/util/cli/style.py,sha256=D_548KG1gXEirQGdkAVTc81vBdCeInXtnG1gV1yabBA,6655
344
344
  zrb/util/cli/subcommand.py,sha256=umTZIlrL-9g-qc_eRRgdaQgK-whvXK1roFfvnbuY7NQ,1753
345
345
  zrb/util/cmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
346
- zrb/util/cmd/command.py,sha256=JTbKftqyqkwQLKuHuFe6XLxrrNlqA0uq0Yr0Fg_mjno,5144
346
+ zrb/util/cmd/command.py,sha256=CsS6KKATOAmM9F482Ox5kVV8hRgFcueqvB5obEcJENs,5211
347
347
  zrb/util/cmd/remote.py,sha256=NGQq2_IrUMDoZz3qmcgtnNYVGjMHaBKQpZxImf0yfXA,1296
348
348
  zrb/util/codemod/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
349
349
  zrb/util/codemod/modification_mode.py,sha256=z_4U2gjskEHkFm6UtBe_Wbm-erufYaXgPbdCQ6CZMlw,128
@@ -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.2.dist-info/METADATA,sha256=MOJ6LKW9FeKZmgUusnLuN4oz1Ll2L6rB8B7YZKuaAks,8385
373
- zrb-1.6.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
374
- zrb-1.6.2.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
375
- zrb-1.6.2.dist-info/RECORD,,
372
+ zrb-1.6.4.dist-info/METADATA,sha256=3bWvvTgCPxLrQNsKrX83QOuDl6K-xS_gY-Rk7mbtEQU,8385
373
+ zrb-1.6.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
374
+ zrb-1.6.4.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
375
+ zrb-1.6.4.dist-info/RECORD,,
File without changes