falyx 0.1.47__py3-none-any.whl → 0.1.49__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.
- falyx/action/base.py +1 -1
- falyx/action/menu_action.py +4 -1
- falyx/action/prompt_menu_action.py +4 -1
- falyx/action/select_file_action.py +4 -1
- falyx/action/selection_action.py +4 -1
- falyx/action/user_input_action.py +4 -1
- falyx/bottom_bar.py +1 -1
- falyx/command.py +1 -1
- falyx/config.py +1 -2
- falyx/context.py +3 -1
- falyx/execution_registry.py +93 -18
- falyx/falyx.py +39 -5
- falyx/init.py +1 -1
- falyx/parsers/argparse.py +25 -25
- falyx/parsers/signature.py +10 -5
- falyx/selection.py +5 -5
- falyx/version.py +1 -1
- {falyx-0.1.47.dist-info → falyx-0.1.49.dist-info}/METADATA +1 -1
- {falyx-0.1.47.dist-info → falyx-0.1.49.dist-info}/RECORD +22 -22
- {falyx-0.1.47.dist-info → falyx-0.1.49.dist-info}/LICENSE +0 -0
- {falyx-0.1.47.dist-info → falyx-0.1.49.dist-info}/WHEEL +0 -0
- {falyx-0.1.47.dist-info → falyx-0.1.49.dist-info}/entry_points.txt +0 -0
falyx/action/base.py
CHANGED
@@ -74,7 +74,7 @@ class BaseAction(ABC):
|
|
74
74
|
self.inject_into: str = inject_into
|
75
75
|
self._never_prompt: bool = never_prompt
|
76
76
|
self._skip_in_chain: bool = False
|
77
|
-
self.console = Console(color_system="
|
77
|
+
self.console = Console(color_system="truecolor")
|
78
78
|
self.options_manager: OptionsManager | None = None
|
79
79
|
|
80
80
|
if logging_hooks:
|
falyx/action/menu_action.py
CHANGED
@@ -51,7 +51,10 @@ class MenuAction(BaseAction):
|
|
51
51
|
self.columns = columns
|
52
52
|
self.prompt_message = prompt_message
|
53
53
|
self.default_selection = default_selection
|
54
|
-
|
54
|
+
if isinstance(console, Console):
|
55
|
+
self.console = console
|
56
|
+
elif console:
|
57
|
+
raise ValueError("`console` must be an instance of `rich.console.Console`")
|
55
58
|
self.prompt_session = prompt_session or PromptSession()
|
56
59
|
self.include_reserved = include_reserved
|
57
60
|
self.show_table = show_table
|
@@ -43,7 +43,10 @@ class PromptMenuAction(BaseAction):
|
|
43
43
|
self.menu_options = menu_options
|
44
44
|
self.prompt_message = prompt_message
|
45
45
|
self.default_selection = default_selection
|
46
|
-
|
46
|
+
if isinstance(console, Console):
|
47
|
+
self.console = console
|
48
|
+
elif console:
|
49
|
+
raise ValueError("`console` must be an instance of `rich.console.Console`")
|
47
50
|
self.prompt_session = prompt_session or PromptSession()
|
48
51
|
self.include_reserved = include_reserved
|
49
52
|
|
@@ -76,7 +76,10 @@ class SelectFileAction(BaseAction):
|
|
76
76
|
self.prompt_message = prompt_message
|
77
77
|
self.suffix_filter = suffix_filter
|
78
78
|
self.style = style
|
79
|
-
|
79
|
+
if isinstance(console, Console):
|
80
|
+
self.console = console
|
81
|
+
elif console:
|
82
|
+
raise ValueError("`console` must be an instance of `rich.console.Console`")
|
80
83
|
self.prompt_session = prompt_session or PromptSession()
|
81
84
|
self.return_type = self._coerce_return_type(return_type)
|
82
85
|
|
falyx/action/selection_action.py
CHANGED
@@ -67,7 +67,10 @@ class SelectionAction(BaseAction):
|
|
67
67
|
self.return_type: SelectionReturnType = self._coerce_return_type(return_type)
|
68
68
|
self.title = title
|
69
69
|
self.columns = columns
|
70
|
-
|
70
|
+
if isinstance(console, Console):
|
71
|
+
self.console = console
|
72
|
+
elif console:
|
73
|
+
raise ValueError("`console` must be an instance of `rich.console.Console`")
|
71
74
|
self.prompt_session = prompt_session or PromptSession()
|
72
75
|
self.default_selection = default_selection
|
73
76
|
self.prompt_message = prompt_message
|
@@ -40,7 +40,10 @@ class UserInputAction(BaseAction):
|
|
40
40
|
)
|
41
41
|
self.prompt_text = prompt_text
|
42
42
|
self.validator = validator
|
43
|
-
|
43
|
+
if isinstance(console, Console):
|
44
|
+
self.console = console
|
45
|
+
elif console:
|
46
|
+
raise ValueError("`console` must be an instance of `rich.console.Console`")
|
44
47
|
self.prompt_session = prompt_session or PromptSession()
|
45
48
|
|
46
49
|
def get_infer_target(self) -> tuple[None, None]:
|
falyx/bottom_bar.py
CHANGED
@@ -30,7 +30,7 @@ class BottomBar:
|
|
30
30
|
key_validator: Callable[[str], bool] | None = None,
|
31
31
|
) -> None:
|
32
32
|
self.columns = columns
|
33
|
-
self.console = Console(color_system="
|
33
|
+
self.console = Console(color_system="truecolor")
|
34
34
|
self._named_items: dict[str, Callable[[], HTML]] = {}
|
35
35
|
self._value_getters: dict[str, Callable[[], Any]] = CaseInsensitiveDict()
|
36
36
|
self.toggle_keys: list[str] = []
|
falyx/command.py
CHANGED
falyx/config.py
CHANGED
@@ -18,11 +18,10 @@ from falyx.action.base import BaseAction
|
|
18
18
|
from falyx.command import Command
|
19
19
|
from falyx.falyx import Falyx
|
20
20
|
from falyx.logger import logger
|
21
|
-
from falyx.parsers import CommandArgumentParser
|
22
21
|
from falyx.retry import RetryPolicy
|
23
22
|
from falyx.themes import OneColors
|
24
23
|
|
25
|
-
console = Console(color_system="
|
24
|
+
console = Console(color_system="truecolor")
|
26
25
|
|
27
26
|
|
28
27
|
def wrap_if_needed(obj: Any, name=None) -> BaseAction | Command:
|
falyx/context.py
CHANGED
@@ -80,8 +80,10 @@ class ExecutionContext(BaseModel):
|
|
80
80
|
start_wall: datetime | None = None
|
81
81
|
end_wall: datetime | None = None
|
82
82
|
|
83
|
+
index: int | None = None
|
84
|
+
|
83
85
|
extra: dict[str, Any] = Field(default_factory=dict)
|
84
|
-
console: Console = Field(default_factory=lambda: Console(color_system="
|
86
|
+
console: Console = Field(default_factory=lambda: Console(color_system="truecolor"))
|
85
87
|
|
86
88
|
shared_context: SharedContext | None = None
|
87
89
|
|
falyx/execution_registry.py
CHANGED
@@ -29,7 +29,8 @@ from __future__ import annotations
|
|
29
29
|
|
30
30
|
from collections import defaultdict
|
31
31
|
from datetime import datetime
|
32
|
-
from
|
32
|
+
from threading import Lock
|
33
|
+
from typing import Any, Literal
|
33
34
|
|
34
35
|
from rich import box
|
35
36
|
from rich.console import Console
|
@@ -70,23 +71,30 @@ class ExecutionRegistry:
|
|
70
71
|
ExecutionRegistry.summary()
|
71
72
|
"""
|
72
73
|
|
73
|
-
_store_by_name:
|
74
|
-
|
75
|
-
|
74
|
+
_store_by_name: dict[str, list[ExecutionContext]] = defaultdict(list)
|
75
|
+
_store_by_index: dict[int, ExecutionContext] = {}
|
76
|
+
_store_all: list[ExecutionContext] = []
|
77
|
+
_console = Console(color_system="truecolor")
|
78
|
+
_index = 0
|
79
|
+
_lock = Lock()
|
76
80
|
|
77
81
|
@classmethod
|
78
82
|
def record(cls, context: ExecutionContext):
|
79
83
|
"""Record an execution context."""
|
80
84
|
logger.debug(context.to_log_line())
|
85
|
+
with cls._lock:
|
86
|
+
context.index = cls._index
|
87
|
+
cls._store_by_index[cls._index] = context
|
88
|
+
cls._index += 1
|
81
89
|
cls._store_by_name[context.name].append(context)
|
82
90
|
cls._store_all.append(context)
|
83
91
|
|
84
92
|
@classmethod
|
85
|
-
def get_all(cls) ->
|
93
|
+
def get_all(cls) -> list[ExecutionContext]:
|
86
94
|
return cls._store_all
|
87
95
|
|
88
96
|
@classmethod
|
89
|
-
def get_by_name(cls, name: str) ->
|
97
|
+
def get_by_name(cls, name: str) -> list[ExecutionContext]:
|
90
98
|
return cls._store_by_name.get(name, [])
|
91
99
|
|
92
100
|
@classmethod
|
@@ -97,11 +105,74 @@ class ExecutionRegistry:
|
|
97
105
|
def clear(cls):
|
98
106
|
cls._store_by_name.clear()
|
99
107
|
cls._store_all.clear()
|
108
|
+
cls._store_by_index.clear()
|
100
109
|
|
101
110
|
@classmethod
|
102
|
-
def summary(
|
103
|
-
|
104
|
-
|
111
|
+
def summary(
|
112
|
+
cls,
|
113
|
+
name: str = "",
|
114
|
+
index: int = -1,
|
115
|
+
result: int = -1,
|
116
|
+
clear: bool = False,
|
117
|
+
last_result: bool = False,
|
118
|
+
status: Literal["all", "success", "error"] = "all",
|
119
|
+
):
|
120
|
+
if clear:
|
121
|
+
cls.clear()
|
122
|
+
cls._console.print(f"[{OneColors.GREEN}]✅ Execution history cleared.")
|
123
|
+
return
|
124
|
+
|
125
|
+
if last_result:
|
126
|
+
for ctx in reversed(cls._store_all):
|
127
|
+
if ctx.name.upper() not in [
|
128
|
+
"HISTORY",
|
129
|
+
"HELP",
|
130
|
+
"EXIT",
|
131
|
+
"VIEW EXECUTION HISTORY",
|
132
|
+
"BACK",
|
133
|
+
]:
|
134
|
+
cls._console.print(ctx.result)
|
135
|
+
return
|
136
|
+
cls._console.print(
|
137
|
+
f"[{OneColors.DARK_RED}]❌ No valid executions found to display last result."
|
138
|
+
)
|
139
|
+
return
|
140
|
+
|
141
|
+
if result and result >= 0:
|
142
|
+
try:
|
143
|
+
result_context = cls._store_by_index[result]
|
144
|
+
except KeyError:
|
145
|
+
cls._console.print(
|
146
|
+
f"[{OneColors.DARK_RED}]❌ No execution found for index {index}."
|
147
|
+
)
|
148
|
+
return
|
149
|
+
cls._console.print(result_context.result)
|
150
|
+
return
|
151
|
+
|
152
|
+
if name:
|
153
|
+
contexts = cls.get_by_name(name)
|
154
|
+
if not contexts:
|
155
|
+
cls._console.print(
|
156
|
+
f"[{OneColors.DARK_RED}]❌ No executions found for action '{name}'."
|
157
|
+
)
|
158
|
+
return
|
159
|
+
title = f"📊 Execution History for '{contexts[0].name}'"
|
160
|
+
elif index and index >= 0:
|
161
|
+
try:
|
162
|
+
contexts = [cls._store_by_index[index]]
|
163
|
+
except KeyError:
|
164
|
+
cls._console.print(
|
165
|
+
f"[{OneColors.DARK_RED}]❌ No execution found for index {index}."
|
166
|
+
)
|
167
|
+
return
|
168
|
+
title = f"📊 Execution History for Index {index}"
|
169
|
+
else:
|
170
|
+
contexts = cls.get_all()
|
171
|
+
title = "📊 Execution History"
|
172
|
+
|
173
|
+
table = Table(title=title, expand=True, box=box.SIMPLE)
|
174
|
+
|
175
|
+
table.add_column("Index", justify="right", style="dim")
|
105
176
|
table.add_column("Name", style="bold cyan")
|
106
177
|
table.add_column("Start", justify="right", style="dim")
|
107
178
|
table.add_column("End", justify="right", style="dim")
|
@@ -109,7 +180,7 @@ class ExecutionRegistry:
|
|
109
180
|
table.add_column("Status", style="bold")
|
110
181
|
table.add_column("Result / Exception", overflow="fold")
|
111
182
|
|
112
|
-
for ctx in
|
183
|
+
for ctx in contexts:
|
113
184
|
start = (
|
114
185
|
datetime.fromtimestamp(ctx.start_time).strftime("%H:%M:%S")
|
115
186
|
if ctx.start_time
|
@@ -122,15 +193,19 @@ class ExecutionRegistry:
|
|
122
193
|
)
|
123
194
|
duration = f"{ctx.duration:.3f}s" if ctx.duration else "n/a"
|
124
195
|
|
125
|
-
if ctx.exception:
|
126
|
-
|
127
|
-
|
196
|
+
if ctx.exception and status.lower() in ["all", "error"]:
|
197
|
+
final_status = f"[{OneColors.DARK_RED}]❌ Error"
|
198
|
+
final_result = repr(ctx.exception)
|
199
|
+
elif status.lower() in ["all", "success"]:
|
200
|
+
final_status = f"[{OneColors.GREEN}]✅ Success"
|
201
|
+
final_result = repr(ctx.result)
|
202
|
+
if len(final_result) > 1000:
|
203
|
+
final_result = f"{final_result[:1000]}..."
|
128
204
|
else:
|
129
|
-
|
130
|
-
result = repr(ctx.result)
|
131
|
-
if len(result) > 1000:
|
132
|
-
result = f"{result[:1000]}..."
|
205
|
+
continue
|
133
206
|
|
134
|
-
table.add_row(
|
207
|
+
table.add_row(
|
208
|
+
str(ctx.index), ctx.name, start, end, duration, final_status, final_result
|
209
|
+
)
|
135
210
|
|
136
211
|
cls._console.print(table)
|
falyx/falyx.py
CHANGED
@@ -201,7 +201,7 @@ class Falyx:
|
|
201
201
|
self.help_command: Command | None = (
|
202
202
|
self._get_help_command() if include_help_command else None
|
203
203
|
)
|
204
|
-
self.console: Console = Console(color_system="
|
204
|
+
self.console: Console = Console(color_system="truecolor", theme=get_nord_theme())
|
205
205
|
self.welcome_message: str | Markdown | dict[str, Any] = welcome_message
|
206
206
|
self.exit_message: str | Markdown | dict[str, Any] = exit_message
|
207
207
|
self.hooks: HookManager = HookManager()
|
@@ -300,6 +300,40 @@ class Falyx:
|
|
300
300
|
|
301
301
|
def _get_history_command(self) -> Command:
|
302
302
|
"""Returns the history command for the menu."""
|
303
|
+
parser = CommandArgumentParser(
|
304
|
+
command_key="Y",
|
305
|
+
command_description="History",
|
306
|
+
command_style=OneColors.DARK_YELLOW,
|
307
|
+
aliases=["HISTORY"],
|
308
|
+
)
|
309
|
+
parser.add_argument(
|
310
|
+
"-n",
|
311
|
+
"--name",
|
312
|
+
help="Filter by execution name.",
|
313
|
+
)
|
314
|
+
parser.add_argument(
|
315
|
+
"-i",
|
316
|
+
"--index",
|
317
|
+
type=int,
|
318
|
+
help="Filter by execution index (0-based).",
|
319
|
+
)
|
320
|
+
parser.add_argument(
|
321
|
+
"-s",
|
322
|
+
"--status",
|
323
|
+
choices=["all", "success", "error"],
|
324
|
+
default="all",
|
325
|
+
help="Filter by execution status (default: all).",
|
326
|
+
)
|
327
|
+
parser.add_argument(
|
328
|
+
"-c",
|
329
|
+
"--clear",
|
330
|
+
action="store_true",
|
331
|
+
help="Clear the Execution History.",
|
332
|
+
)
|
333
|
+
parser.add_argument("-r", "--result", type=int, help="Get the result by index")
|
334
|
+
parser.add_argument(
|
335
|
+
"-l", "--last-result", action="store_true", help="Get the last result"
|
336
|
+
)
|
303
337
|
return Command(
|
304
338
|
key="Y",
|
305
339
|
description="History",
|
@@ -307,6 +341,8 @@ class Falyx:
|
|
307
341
|
action=Action(name="View Execution History", action=er.summary),
|
308
342
|
style=OneColors.DARK_YELLOW,
|
309
343
|
simple_help_signature=True,
|
344
|
+
arg_parser=parser,
|
345
|
+
help_text="View the execution history of commands.",
|
310
346
|
)
|
311
347
|
|
312
348
|
async def _show_help(self, tag: str = "") -> None:
|
@@ -746,12 +782,10 @@ class Falyx:
|
|
746
782
|
"""
|
747
783
|
table = Table(title=self.title, show_header=False, box=box.SIMPLE) # type: ignore[arg-type]
|
748
784
|
visible_commands = [item for item in self.commands.items() if not item[1].hidden]
|
749
|
-
space = self.console.width // self.columns
|
750
785
|
for chunk in chunks(visible_commands, self.columns):
|
751
786
|
row = []
|
752
787
|
for key, command in chunk:
|
753
|
-
|
754
|
-
row.append(f"{cell:<{space}}")
|
788
|
+
row.append(f"[{key}] [{command.style}]{command.description}")
|
755
789
|
table.add_row(*row)
|
756
790
|
bottom_row = self.get_bottom_row()
|
757
791
|
for row in chunks(bottom_row, self.columns):
|
@@ -811,7 +845,7 @@ class Falyx:
|
|
811
845
|
args, kwargs = await name_map[choice].parse_args(
|
812
846
|
input_args, from_validate
|
813
847
|
)
|
814
|
-
except CommandArgumentError as error:
|
848
|
+
except (CommandArgumentError, Exception) as error:
|
815
849
|
if not from_validate:
|
816
850
|
name_map[choice].show_help()
|
817
851
|
self.console.print(f"[{OneColors.DARK_RED}]❌ [{choice}]: {error}")
|
falyx/init.py
CHANGED
falyx/parsers/argparse.py
CHANGED
@@ -159,7 +159,7 @@ class CommandArgumentParser:
|
|
159
159
|
aliases: list[str] | None = None,
|
160
160
|
) -> None:
|
161
161
|
"""Initialize the CommandArgumentParser."""
|
162
|
-
self.console = Console(color_system="
|
162
|
+
self.console = Console(color_system="truecolor")
|
163
163
|
self.command_key: str = command_key
|
164
164
|
self.command_description: str = command_description
|
165
165
|
self.command_style: str = command_style
|
@@ -292,10 +292,10 @@ class CommandArgumentParser:
|
|
292
292
|
if not isinstance(choice, expected_type):
|
293
293
|
try:
|
294
294
|
coerce_value(choice, expected_type)
|
295
|
-
except Exception:
|
295
|
+
except Exception as error:
|
296
296
|
raise CommandArgumentError(
|
297
|
-
f"Invalid choice {choice!r}: not coercible to {expected_type.__name__}"
|
298
|
-
)
|
297
|
+
f"Invalid choice {choice!r}: not coercible to {expected_type.__name__} error: {error}"
|
298
|
+
) from error
|
299
299
|
return choices
|
300
300
|
|
301
301
|
def _validate_default_type(
|
@@ -305,10 +305,10 @@ class CommandArgumentParser:
|
|
305
305
|
if default is not None and not isinstance(default, expected_type):
|
306
306
|
try:
|
307
307
|
coerce_value(default, expected_type)
|
308
|
-
except Exception:
|
308
|
+
except Exception as error:
|
309
309
|
raise CommandArgumentError(
|
310
|
-
f"Default value {default!r} for '{dest}' cannot be coerced to {expected_type.__name__}"
|
311
|
-
)
|
310
|
+
f"Default value {default!r} for '{dest}' cannot be coerced to {expected_type.__name__} error: {error}"
|
311
|
+
) from error
|
312
312
|
|
313
313
|
def _validate_default_list_type(
|
314
314
|
self, default: list[Any], expected_type: type, dest: str
|
@@ -318,10 +318,10 @@ class CommandArgumentParser:
|
|
318
318
|
if not isinstance(item, expected_type):
|
319
319
|
try:
|
320
320
|
coerce_value(item, expected_type)
|
321
|
-
except Exception:
|
321
|
+
except Exception as error:
|
322
322
|
raise CommandArgumentError(
|
323
|
-
f"Default list value {default!r} for '{dest}' cannot be coerced to {expected_type.__name__}"
|
324
|
-
)
|
323
|
+
f"Default list value {default!r} for '{dest}' cannot be coerced to {expected_type.__name__} error: {error}"
|
324
|
+
) from error
|
325
325
|
|
326
326
|
def _validate_resolver(
|
327
327
|
self, action: ArgumentAction, resolver: BaseAction | None
|
@@ -597,10 +597,10 @@ class CommandArgumentParser:
|
|
597
597
|
|
598
598
|
try:
|
599
599
|
typed = [coerce_value(value, spec.type) for value in values]
|
600
|
-
except Exception:
|
600
|
+
except Exception as error:
|
601
601
|
raise CommandArgumentError(
|
602
|
-
f"Invalid value for '{spec.dest}':
|
603
|
-
)
|
602
|
+
f"Invalid value for '{spec.dest}': {error}"
|
603
|
+
) from error
|
604
604
|
if spec.action == ArgumentAction.ACTION:
|
605
605
|
assert isinstance(
|
606
606
|
spec.resolver, BaseAction
|
@@ -684,10 +684,10 @@ class CommandArgumentParser:
|
|
684
684
|
typed_values = [
|
685
685
|
coerce_value(value, spec.type) for value in values
|
686
686
|
]
|
687
|
-
except ValueError:
|
687
|
+
except ValueError as error:
|
688
688
|
raise CommandArgumentError(
|
689
|
-
f"Invalid value for '{spec.dest}':
|
690
|
-
)
|
689
|
+
f"Invalid value for '{spec.dest}': {error}"
|
690
|
+
) from error
|
691
691
|
try:
|
692
692
|
result[spec.dest] = await spec.resolver(*typed_values)
|
693
693
|
except Exception as error:
|
@@ -715,10 +715,10 @@ class CommandArgumentParser:
|
|
715
715
|
typed_values = [
|
716
716
|
coerce_value(value, spec.type) for value in values
|
717
717
|
]
|
718
|
-
except ValueError:
|
718
|
+
except ValueError as error:
|
719
719
|
raise CommandArgumentError(
|
720
|
-
f"Invalid value for '{spec.dest}':
|
721
|
-
)
|
720
|
+
f"Invalid value for '{spec.dest}': {error}"
|
721
|
+
) from error
|
722
722
|
if spec.nargs is None:
|
723
723
|
result[spec.dest].append(spec.type(values[0]))
|
724
724
|
else:
|
@@ -732,10 +732,10 @@ class CommandArgumentParser:
|
|
732
732
|
typed_values = [
|
733
733
|
coerce_value(value, spec.type) for value in values
|
734
734
|
]
|
735
|
-
except ValueError:
|
735
|
+
except ValueError as error:
|
736
736
|
raise CommandArgumentError(
|
737
|
-
f"Invalid value for '{spec.dest}':
|
738
|
-
)
|
737
|
+
f"Invalid value for '{spec.dest}': {error}"
|
738
|
+
) from error
|
739
739
|
result[spec.dest].extend(typed_values)
|
740
740
|
consumed_indices.update(range(i, new_i))
|
741
741
|
i = new_i
|
@@ -745,10 +745,10 @@ class CommandArgumentParser:
|
|
745
745
|
typed_values = [
|
746
746
|
coerce_value(value, spec.type) for value in values
|
747
747
|
]
|
748
|
-
except ValueError:
|
748
|
+
except ValueError as error:
|
749
749
|
raise CommandArgumentError(
|
750
|
-
f"Invalid value for '{spec.dest}':
|
751
|
-
)
|
750
|
+
f"Invalid value for '{spec.dest}': {error}"
|
751
|
+
) from error
|
752
752
|
if not typed_values and spec.nargs not in ("*", "?"):
|
753
753
|
raise CommandArgumentError(
|
754
754
|
f"Expected at least one value for '{spec.dest}'"
|
falyx/parsers/signature.py
CHANGED
@@ -31,11 +31,16 @@ def infer_args_from_func(
|
|
31
31
|
):
|
32
32
|
continue
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
if metadata.get("type"):
|
35
|
+
arg_type = metadata["type"]
|
36
|
+
else:
|
37
|
+
arg_type = (
|
38
|
+
param.annotation
|
39
|
+
if param.annotation is not inspect.Parameter.empty
|
40
|
+
else str
|
41
|
+
)
|
42
|
+
if isinstance(arg_type, str):
|
43
|
+
arg_type = str
|
39
44
|
default = param.default if param.default is not inspect.Parameter.empty else None
|
40
45
|
is_required = param.default is inspect.Parameter.empty
|
41
46
|
if is_required:
|
falyx/selection.py
CHANGED
@@ -273,7 +273,7 @@ async def prompt_for_index(
|
|
273
273
|
show_table: bool = True,
|
274
274
|
) -> int:
|
275
275
|
prompt_session = prompt_session or PromptSession()
|
276
|
-
console = console or Console(color_system="
|
276
|
+
console = console or Console(color_system="truecolor")
|
277
277
|
|
278
278
|
if show_table:
|
279
279
|
console.print(table, justify="center")
|
@@ -298,7 +298,7 @@ async def prompt_for_selection(
|
|
298
298
|
) -> str:
|
299
299
|
"""Prompt the user to select a key from a set of options. Return the selected key."""
|
300
300
|
prompt_session = prompt_session or PromptSession()
|
301
|
-
console = console or Console(color_system="
|
301
|
+
console = console or Console(color_system="truecolor")
|
302
302
|
|
303
303
|
if show_table:
|
304
304
|
console.print(table, justify="center")
|
@@ -351,7 +351,7 @@ async def select_value_from_list(
|
|
351
351
|
highlight=highlight,
|
352
352
|
)
|
353
353
|
prompt_session = prompt_session or PromptSession()
|
354
|
-
console = console or Console(color_system="
|
354
|
+
console = console or Console(color_system="truecolor")
|
355
355
|
|
356
356
|
selection_index = await prompt_for_index(
|
357
357
|
len(selections) - 1,
|
@@ -376,7 +376,7 @@ async def select_key_from_dict(
|
|
376
376
|
) -> Any:
|
377
377
|
"""Prompt for a key from a dict, returns the key."""
|
378
378
|
prompt_session = prompt_session or PromptSession()
|
379
|
-
console = console or Console(color_system="
|
379
|
+
console = console or Console(color_system="truecolor")
|
380
380
|
|
381
381
|
console.print(table, justify="center")
|
382
382
|
|
@@ -401,7 +401,7 @@ async def select_value_from_dict(
|
|
401
401
|
) -> Any:
|
402
402
|
"""Prompt for a key from a dict, but return the value."""
|
403
403
|
prompt_session = prompt_session or PromptSession()
|
404
|
-
console = console or Console(color_system="
|
404
|
+
console = console or Console(color_system="truecolor")
|
405
405
|
|
406
406
|
console.print(table, justify="center")
|
407
407
|
|
falyx/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.1.
|
1
|
+
__version__ = "0.1.49"
|
@@ -6,56 +6,56 @@ falyx/action/__init__.py,sha256=4E3Rb0GgGcmggrPJh0YFiwbVgN_PQjIzL06-Z3qMReo,1247
|
|
6
6
|
falyx/action/action.py,sha256=w6xDbsB1SlMPSvpo2Dh0e11lRGP6a4E3K6AdfjlEqGY,5759
|
7
7
|
falyx/action/action_factory.py,sha256=br-P7Oip-4tZkO8qVT_ECwLe6idYjJa_GuBi5QR7vS4,4832
|
8
8
|
falyx/action/action_group.py,sha256=dfCEJM0RfdopuLFtfaxpvNzbZT6hVMrUuRBAFz--Uss,6835
|
9
|
-
falyx/action/base.py,sha256=
|
9
|
+
falyx/action/base.py,sha256=B7mt66oznmhv2qpSOwOuScgMckVXrxjRMU2buzZkRD8,5866
|
10
10
|
falyx/action/chained_action.py,sha256=aV_plUdDVdc1o-oU57anbWkw33jgRIh4W29QwEA_1Mw,8501
|
11
11
|
falyx/action/fallback_action.py,sha256=0z5l0s_LKnhIwgMdykm8lJqs246DKSpyYs-p7PnsKok,1619
|
12
12
|
falyx/action/http_action.py,sha256=DNeSBWh58UTFGlfFyTk2GnhS54hpLAJLC0QNbq2cYic,5799
|
13
13
|
falyx/action/io_action.py,sha256=8x9HpvLhqJF7lI8PUo7Hs9F2NdJ1WfGs_wP5Myyoor8,10059
|
14
14
|
falyx/action/literal_input_action.py,sha256=7H2VX_L5VaytVdV2uis-VTGi782kQtwKTB8T04c7J1k,1293
|
15
|
-
falyx/action/menu_action.py,sha256=
|
15
|
+
falyx/action/menu_action.py,sha256=Nvvz7XsVnKgx6flW1ARaQOmSIZZtYmWTTFl2XNyUp7k,5882
|
16
16
|
falyx/action/mixins.py,sha256=eni8_PwzMnuwh0ZqOdzCdAyWlOphoiqL7z27xnFsg5s,1117
|
17
17
|
falyx/action/process_action.py,sha256=HsDqlKy1PkG3HHC6mHa4O6ayY_oKVY2qj5nDRJuSn24,4571
|
18
18
|
falyx/action/process_pool_action.py,sha256=1fFVEKpe-_XiMJxo4xF-j749Yd1noXjf76EOCPeX9xA,5940
|
19
|
-
falyx/action/prompt_menu_action.py,sha256=
|
20
|
-
falyx/action/select_file_action.py,sha256=
|
21
|
-
falyx/action/selection_action.py,sha256=
|
19
|
+
falyx/action/prompt_menu_action.py,sha256=corzjpPNVMYKncfueeRUWwklnlZHN-Fc61psOzbZELg,5286
|
20
|
+
falyx/action/select_file_action.py,sha256=zhkBIJw6OZ-AYShAzcmAkbZPPF3pXGmLUDZRx4N0jzE,8726
|
21
|
+
falyx/action/selection_action.py,sha256=UxAFoKqkeEA84V_JqsuTlzlfCZdQHDspSXig71iM_J0,13017
|
22
22
|
falyx/action/signal_action.py,sha256=5UMqvzy7fBnLANGwYUWoe1VRhrr7e-yOVeLdOnCBiJo,1350
|
23
23
|
falyx/action/types.py,sha256=NfZz1ufZuvCgp-he2JIItbnjX7LjOUadjtKbjpRlSIY,1399
|
24
|
-
falyx/action/user_input_action.py,sha256=
|
25
|
-
falyx/bottom_bar.py,sha256=
|
26
|
-
falyx/command.py,sha256=
|
27
|
-
falyx/config.py,sha256=
|
28
|
-
falyx/context.py,sha256=
|
24
|
+
falyx/action/user_input_action.py,sha256=w9QTjKbdPmhXleX_XxUKS9VvNyKpwTtcuXBX7067seA,3606
|
25
|
+
falyx/bottom_bar.py,sha256=KPACb9VC0I3dv_pYZLqy7e4uA_KT5dSfwnvuknyV0FI,7388
|
26
|
+
falyx/command.py,sha256=LmtoI4NbW_zEy_f1AlZ-obl83K5l07Sac0zXJt6xQYc,16419
|
27
|
+
falyx/config.py,sha256=Cm1F9SfNSbugPALxaEz7NRqp1wrk-g2jYq35bQzN2uE,9658
|
28
|
+
falyx/context.py,sha256=EJIWQxU3SeAcufq6_WrAVIAs6abpY4-ttcemH3RVFnQ,10365
|
29
29
|
falyx/debug.py,sha256=IRpYtdH8yeXJEsfP5rASALmBQb2U_EwrTudF2GIDdZY,1545
|
30
30
|
falyx/exceptions.py,sha256=kK9k1v7LVNjJSwYztRa9Krhr3ZOI-6Htq2ZjlYICPKg,922
|
31
|
-
falyx/execution_registry.py,sha256=
|
32
|
-
falyx/falyx.py,sha256=
|
31
|
+
falyx/execution_registry.py,sha256=Ke3DlvG1pYvjwEG7fgb4KPNqCTj1MyYC9m9yd1oxmWk,7341
|
32
|
+
falyx/falyx.py,sha256=LL7KzQW1O9eFtU_SGVvG-3RHlMErVsQ3l4V7H678Z7s,49272
|
33
33
|
falyx/hook_manager.py,sha256=TFuHQnAncS_rk6vuw-VSx8bnAppLuHfrZCrzLwqcO9o,2979
|
34
34
|
falyx/hooks.py,sha256=xMfQROib0BNsaQF4AXJpmCiGePoE1f1xpcdibgnVZWM,2913
|
35
|
-
falyx/init.py,sha256=
|
35
|
+
falyx/init.py,sha256=F9jg7mLPoBWXdJnc_fyWG7zVQSnrAO8ueDiP8AJxDWE,3331
|
36
36
|
falyx/logger.py,sha256=1Mfb_vJFJ1tQwziuyU2p-cSMi2Js8N2byniFEnI6vOQ,132
|
37
37
|
falyx/menu.py,sha256=E580qZsx08bnWcqRVjJuD2Fy8Zh_1zIexp5f0lC7L2c,3745
|
38
38
|
falyx/options_manager.py,sha256=dFAnQw543tQ6Xupvh1PwBrhiSWlSACHw8K-sHP_lUh4,2842
|
39
39
|
falyx/parsers/.pytyped,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
40
40
|
falyx/parsers/__init__.py,sha256=ZfPmbtEUechDvgl99-lWhTXmFnXS_FMXJ_xb8KGEJLo,448
|
41
|
-
falyx/parsers/argparse.py,sha256=
|
41
|
+
falyx/parsers/argparse.py,sha256=P_MS5YjtHJjEgAR8pm41SLndZhvCOCYfygv6svkMFu8,37401
|
42
42
|
falyx/parsers/parsers.py,sha256=MXWC8OQ3apDaeKfY0O4J8NnkxofWVOCRnKatC00lGm0,8796
|
43
|
-
falyx/parsers/signature.py,sha256=
|
43
|
+
falyx/parsers/signature.py,sha256=cCa-yKUcbbET0Ho45oFZWWHFGCX5a_LaAOWRP7b87po,2465
|
44
44
|
falyx/parsers/utils.py,sha256=w_UzvvP62EDKXWSf3jslEsJfd45usGyFqXKNziQhLRI,2893
|
45
45
|
falyx/prompt_utils.py,sha256=qgk0bXs7mwzflqzWyFhEOTpKQ_ZtMIqGhKeg-ocwNnE,1542
|
46
46
|
falyx/protocols.py,sha256=-9GbCBUzzsEgw2_KOCYqxxzWJuez0eHmwnZp_ShY0jc,493
|
47
47
|
falyx/retry.py,sha256=sGRE9QhdZK98M99G8F15WUsJ_fYLNyLlCgu3UANaSQs,3744
|
48
48
|
falyx/retry_utils.py,sha256=vwoZmFVCGVqZ13BX_xi3qZZVsmSxkp-jfaf6kJtBV9c,723
|
49
|
-
falyx/selection.py,sha256=
|
49
|
+
falyx/selection.py,sha256=PxjsO2qqN-_7algR-rUnkjC-WAPTkCY8khMVr-BswrU,12919
|
50
50
|
falyx/signals.py,sha256=Y_neFXpfHs7qY0syw9XcfR9WeAGRcRw1nG_2L1JJqKE,1083
|
51
51
|
falyx/tagged_table.py,sha256=4SV-SdXFrAhy1JNToeBCvyxT-iWVf6cWY7XETTys4n8,1067
|
52
52
|
falyx/themes/__init__.py,sha256=1CZhEUCin9cUk8IGYBUFkVvdHRNNJBEFXccHwpUKZCA,284
|
53
53
|
falyx/themes/colors.py,sha256=4aaeAHJetmeNInI0Zytg4E3YqKfPFelpf04vtjSvsS8,19776
|
54
54
|
falyx/utils.py,sha256=U45xnZFUdoFC4xiji_9S1jHS5V7MvxSDtufP8EgB0SM,6732
|
55
55
|
falyx/validators.py,sha256=t5iyzVpY8tdC4rfhr4isEfWpD5gNTzjeX_Hbi_Uq6sA,1328
|
56
|
-
falyx/version.py,sha256=
|
57
|
-
falyx-0.1.
|
58
|
-
falyx-0.1.
|
59
|
-
falyx-0.1.
|
60
|
-
falyx-0.1.
|
61
|
-
falyx-0.1.
|
56
|
+
falyx/version.py,sha256=6ak6J_3GLVYH79iSCY8wWsCV4clQHUuDdcBlOnUh9K8,23
|
57
|
+
falyx-0.1.49.dist-info/LICENSE,sha256=B0yqgaHuSdhN7T3OBmgQSiDTy8HqT5Oe_dLypRe4Ra4,1073
|
58
|
+
falyx-0.1.49.dist-info/METADATA,sha256=uIl8tUOOoQzWV810xzwogyxWfNCRYYTZR684_8SXFcw,5561
|
59
|
+
falyx-0.1.49.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
60
|
+
falyx-0.1.49.dist-info/entry_points.txt,sha256=j8owOSl2j1Ss8DtGMnKfgehKaolqnIPhVFHaUBLUnMs,45
|
61
|
+
falyx-0.1.49.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|