questo
Advanced tools
+1
-1
| Metadata-Version: 2.1 | ||
| Name: questo | ||
| Version: 0.1.2 | ||
| Version: 0.2.0 | ||
| Summary: A library of extensible and modular CLI prompt elements | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/petereon/questo |
+1
-1
| [tool.poetry] | ||
| name = "questo" | ||
| version = "0.1.2" | ||
| version = "0.2.0" | ||
| description = "A library of extensible and modular CLI prompt elements" | ||
@@ -5,0 +5,0 @@ authors = ["Peter Vyboch <pvyboch1@gmail.com>"] |
@@ -35,3 +35,4 @@ import copy | ||
| console (Optional[Console], optional): rich.Console instance to use for displaying. Defaults to Console(highlight=False). | ||
| reactive (bool, optional): Flag that configures whether the element automatically rerenders on state assignment. Defaults to True. | ||
| reactive (bool, optional): Flag that configures whether the element automatically rerenders on state assignment. | ||
| Defaults to True. | ||
| copy (bool, optional): Flag that configures whether the state will be deep-copied when read or assigned. Defaults to True. | ||
@@ -46,3 +47,3 @@ """ | ||
| @contextmanager | ||
| def diplayed(self, console: Optional[Console] = None) -> None: | ||
| def displayed(self, console: Optional[Console] = None) -> None: | ||
| """Context that displays the element | ||
@@ -49,0 +50,0 @@ |
@@ -7,3 +7,3 @@ from contextlib import contextmanager | ||
| _NO_STATE_ERROR = RuntimeError('No state provided. Please assing a state to the `.state` property.') | ||
| _NO_STATE_ERROR = RuntimeError('No state provided. Please assign a state to the `.state` property.') | ||
@@ -10,0 +10,0 @@ |
@@ -14,6 +14,8 @@ import copy | ||
| if s.completion.in_completion_ctx and s.completion.options: | ||
| s.completion.index, s.cursor_position, s.value = completions_options_step(1, s) | ||
| s.completion.index, s.cursor_position, s.value = completions_options_step(s) | ||
| else: | ||
| s.completion.in_completion_ctx = True | ||
| s.completion.index = 0 | ||
| s.value = s.completion.options[s.completion.index] | ||
| s.cursor_position = len(s.value) | ||
| else: | ||
@@ -53,3 +55,3 @@ s.completion.in_completion_ctx = False | ||
| s.exit = True | ||
| elif keypress: | ||
| elif keypress.is_printable: | ||
| if not (keypress == Keys.TAB and s.completion.in_completion_ctx): | ||
@@ -64,6 +66,6 @@ value_chars = [*s.value] | ||
| def completions_options_step(step: int, state: PromptState) -> Tuple[int, int, str]: | ||
| index = (state.completion.index + step) % len(state.completion.options) | ||
| def completions_options_step(state: PromptState) -> Tuple[int, int, str]: | ||
| index = (state.completion.index + 1) % len(state.completion.options) | ||
| value = state.completion.options[index] | ||
| cursor_positon = len(value) | ||
| return index, cursor_positon, value |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
24529
0.48%399
0.76%