ask
Symbol Details
class: ChoiceTyped
class ChoiceTyped:
name: str
value: ~T
description: str | None = None
checked: bool = False
| Field |
Type |
Default |
Since |
| name |
str |
- |
0.3.0 |
| value |
~T |
- |
0.3.0 |
| description |
str | None |
None |
0.3.0 |
| checked |
bool |
False |
0.3.0 |
Changes
| Version |
Change |
| 0.3.0 |
Made public |
Changes
| Version |
Change |
| 0.3.0 |
Made public |
class: NewHandlerChoice
class NewHandlerChoice:
constructor: Callable[[<class 'str'>], ~T]
new_prompt: str
| Field |
Type |
Default |
Since |
| constructor |
Callable[[<class 'str'>], ~T] |
- |
0.3.0 |
| new_prompt |
str |
- |
0.3.0 |
Changes
| Version |
Change |
| 0.3.0 |
Made public |
class: PromptMatch
class PromptMatch:
response: str | None = None
responses: list[str] = ...
substring: str = ''
exact: str = ''
max_matches: int = 1
matches_so_far: int = 0
| Field |
Type |
Default |
Since |
| response |
str | None |
None |
0.3.0 |
| responses |
list[str] |
... |
0.3.0 |
| substring |
str |
'' |
0.3.0 |
| exact |
str |
'' |
0.3.0 |
| max_matches |
int |
1 |
0.3.0 |
| matches_so_far |
int |
0 |
0.3.0 |
Changes
| Version |
Change |
| 0.3.0 |
Made public |
exception: RaiseOnQuestionError
class RaiseOnQuestionError(Exception):
...
Changes
| Version |
Change |
| 0.3.0 |
Made public |
class: SelectOptions
class SelectOptions(BaseModel):
use_search_filter: bool | object = <object object>
use_shortcuts: bool | object = <object object>
use_jk_keys: bool | object = <object object>
new_handler_choice: NewHandlerChoice[~T] | None = None
| Field |
Type |
Default |
Since |
| use_search_filter |
bool | object |
<object object> |
0.3.0 |
| use_shortcuts |
bool | object |
<object object> |
0.3.0 |
| use_jk_keys |
bool | object |
<object object> |
0.3.0 |
| new_handler_choice |
NewHandlerChoice[~T] | None |
None |
0.3.0 |
Changes
| Version |
Change |
| 0.3.0 |
Made public |
function: confirm
def confirm(prompt_text: str, *, default: bool | None = None) -> bool:
...
Changes
| Version |
Change |
| 0.3.0 |
Made public |
class: force_interactive
class force_interactive:
settings: AskShellSettings = ...
| Field |
Type |
Default |
Since |
| settings |
AskShellSettings |
... |
0.3.0 |
Changes
| Version |
Change |
| 0.3.0 |
Made public |
class: question_patcher
class question_patcher(force_interactive):
settings: AskShellSettings = ...
responses: list[str] = ...
next_response: int = 0
dynamic_responses: list[PromptMatch] = ...
Context manager to patch the questionary.ask_question, useful for testing.
Uses PlainTextOutput with a controlled buffer and direct unsafe_ask() calls
to avoid I/O conflicts with Click's CliRunner. The CliRunner replaces
sys.stdout/stderr with its own wrappers, and if we use DummyOutput or
thread pools, prompt_toolkit may still write to closed streams.
| Field |
Type |
Default |
Since |
| settings |
AskShellSettings |
... |
0.3.0 |
| responses |
list[str] |
... |
0.3.0 |
| next_response |
int |
0 |
0.3.0 |
| dynamic_responses |
list[PromptMatch] |
... |
0.3.0 |
Changes
| Version |
Change |
| 0.3.0 |
Made public |
class: raise_on_question
class raise_on_question(force_interactive):
settings: AskShellSettings = ...
raise_error: Callable[[<class 'str'>], BaseException] = <class 'ask_shell._internal.interactive.RaiseOnQuestionError'>
| Field |
Type |
Default |
Since |
| settings |
AskShellSettings |
... |
0.3.0 |
| raise_error |
Callable[[<class 'str'>], BaseException] |
<class 'ask_shell._internal.interactive.RaiseOnQuestionError'> |
0.3.0 |
Changes
| Version |
Change |
| 0.3.0 |
Made public |
function: select_dict
def select_dict(prompt_text: str, choices: dict[str, ~T], *, default: str | None = None, options: SelectOptions | None = None) -> ~T:
...
Changes
| Version |
Change |
| 0.3.0 |
Made public |
function: select_list
def select_list(prompt_text: str, choices: list[str], *, default: str | None = None, options: SelectOptions | None = None) -> str:
...
Changes
| Version |
Change |
| 0.3.0 |
Made public |
function: select_list_choice
def select_list_choice(prompt_text: str, choices: list[ChoiceTyped[~T]], *, default: ~T | None = None, options: SelectOptions | None = None) -> ~T:
...
Changes
| Version |
Change |
| 0.3.0 |
Made public |
function: select_list_multiple
def select_list_multiple(prompt_text: str, choices: list[str], *, default: list[str] | None = None, options: SelectOptions | None = None) -> list[str]:
...
Changes
| Version |
Change |
| 0.3.0 |
Made public |
function: select_list_multiple_choices
def select_list_multiple_choices(prompt_text: str, choices: list[ChoiceTyped[~T]], default: list[~T] | None = None, *, options: SelectOptions | None = None) -> list[~T]:
...
Changes
| Version |
Change |
| 0.3.0 |
Made public |
function: text
def text(prompt_text: str, default: str = '') -> str:
...
Changes
| Version |
Change |
| 0.3.0 |
Made public |