inquirer-textual 0.3.0__tar.gz → 0.4.0__tar.gz
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.
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/PKG-INFO +1 -1
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/simple_multi_prompt.py +4 -4
- inquirer_textual-0.4.0/docs/themes/catppuccin_mocha.gif +0 -0
- inquirer_textual-0.4.0/docs/themes/catppuccin_mocha.tape +27 -0
- inquirer_textual-0.4.0/docs/themes/index.md +18 -0
- inquirer_textual-0.4.0/docs/themes/nord.gif +0 -0
- inquirer_textual-0.4.0/docs/themes/nord.tape +27 -0
- inquirer_textual-0.4.0/docs/themes/solarized_light.gif +0 -0
- inquirer_textual-0.4.0/docs/themes/solarized_light.tape +27 -0
- inquirer_textual-0.4.0/docs/themes/textual_dark.gif +0 -0
- inquirer_textual-0.4.0/docs/themes/textual_dark.tape +27 -0
- inquirer_textual-0.4.0/docs/themes/textual_light.gif +0 -0
- inquirer_textual-0.4.0/docs/themes/textual_light.tape +27 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/alternatives/python-inquirer/main.py +10 -1
- inquirer_textual-0.4.0/examples/pizza.py +21 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_external.py +2 -2
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_multi.py +9 -9
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_select.py +1 -1
- inquirer_textual-0.4.0/examples/themes.py +36 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/InquirerApp.py +7 -11
- inquirer_textual-0.4.0/inquirer_textual/common/Answer.py +22 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/common/ChoiceLabel.py +6 -6
- inquirer_textual-0.3.0/inquirer_textual/common/PromptMessage.py → inquirer_textual-0.4.0/inquirer_textual/common/Prompt.py +3 -3
- inquirer_textual-0.4.0/inquirer_textual/common/defaults.py +24 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/prompts.py +1 -1
- inquirer_textual-0.4.0/inquirer_textual/version.py +1 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerCheckbox.py +6 -14
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerConfirm.py +23 -7
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerEditor.py +2 -2
- inquirer_textual-0.4.0/inquirer_textual/widgets/InquirerMulti.py +45 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerNumber.py +3 -4
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerPath.py +7 -5
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerPattern.py +29 -23
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerSecret.py +3 -4
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerSelect.py +27 -23
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerText.py +3 -4
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/mkdocs.yml +1 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/pyproject.toml +2 -1
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/__snapshots__/test_InquirerApp/test_snapshot_shortcut.svg +2 -2
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/__snapshots__/test_InquirerApp/test_snapshot_shortcut_no_description.svg +2 -2
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/common/__snapshots__/test_ChoiceLabel/test_snapshot_with_pattern.svg +1 -1
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerCheckbox/test_snapshot_select_value.svg +2 -1
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot.svg +1 -1
- inquirer_textual-0.3.0/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_fourth_input.svg → inquirer_textual-0.4.0/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_fifth_input.svg +7 -6
- inquirer_textual-0.4.0/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_fifth_input_pick_default.svg +153 -0
- inquirer_textual-0.3.0/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_second_input.svg → inquirer_textual-0.4.0/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_fourth_input.svg +6 -6
- inquirer_textual-0.4.0/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_second_input.svg +153 -0
- inquirer_textual-0.4.0/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_third_input.svg +153 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerNumber/test_snapshot.svg +1 -1
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerPath/test_snapshot.svg +2 -2
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerPath/test_snapshot_with_default_value.svg +2 -2
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerPath/test_validation_failure.svg +2 -2
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerPattern/test_snapshot_pattern_search.svg +1 -1
- inquirer_textual-0.4.0/tests/widgets/__snapshots__/test_InquirerPattern/test_snapshot_select.svg +152 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerSecret/test_snapshot.svg +1 -1
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerSecret/test_snapshot_hide_input.svg +1 -1
- inquirer_textual-0.4.0/tests/widgets/__snapshots__/test_InquirerSelect/test_snapshot_not_mandatory.svg +152 -0
- inquirer_textual-0.4.0/tests/widgets/__snapshots__/test_InquirerSelect/test_snapshot_select.svg +152 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerText/test_snapshot.svg +1 -1
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerText/test_snapshot_with_default_value.svg +1 -1
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerMulti.py +36 -36
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerPattern.py +11 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerSelect.py +13 -1
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/uv.lock +29 -8
- inquirer_textual-0.3.0/inquirer_textual/common/AppConfig.py +0 -9
- inquirer_textual-0.3.0/inquirer_textual/common/StandardTheme.py +0 -10
- inquirer_textual-0.3.0/inquirer_textual/version.py +0 -1
- inquirer_textual-0.3.0/inquirer_textual/widgets/InquirerMulti.py +0 -47
- inquirer_textual-0.3.0/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_fifth_input.svg +0 -152
- inquirer_textual-0.3.0/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_fifth_input_pick_default.svg +0 -152
- inquirer_textual-0.3.0/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_third_input.svg +0 -152
- inquirer_textual-0.3.0/tests/widgets/__snapshots__/test_InquirerSelect/test_snapshot_not_mandatory.svg +0 -152
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/.capm.yml +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/.github/dependabot.yml +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/.github/workflows/code-analysis.yml +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/.github/workflows/documentation.yml +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/.github/workflows/main.yml +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/.github/workflows/release.yml +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/.gitignore +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/CHANGELOG.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/LICENSE +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/README.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/assets/favicon.ico +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/assets/logo-light.png +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/apps/app.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/apps/app.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/apps/app.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/checkbox.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/checkbox.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/checkbox.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/confirm.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/confirm.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/confirm.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/editor.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/editor.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/editor.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/external.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/external.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/external.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/multi.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/multi.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/multi.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/number.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/number.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/number.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/path.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/path.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/path.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/pattern.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/pattern.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/pattern.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/secret.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/secret.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/secret.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/select.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/select.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/select.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/text.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/text.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/examples/prompts/text.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/faq.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/index.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/simple_multi_prompt.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/simple_multi_prompt.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/simple_text_prompt.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/simple_text_prompt.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/simple_text_prompt.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/simple_text_prompts.gif +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/simple_text_prompts.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/simple_text_prompts.tape +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/index.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/reference/checkbox.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/reference/confirm.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/reference/editor.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/reference/multi.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/reference/number.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/reference/path.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/reference/pattern.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/reference/secret.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/reference/select.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/reference/text.md +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/alternatives/inquirerpy/main.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/app.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/app_header.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/app_shortcuts.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_checkbox.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_confirm.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_editor.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_number.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_path.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_pattern.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_secret.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/prompt_text.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/shortcuts.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/validator.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/__init__.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/common/Choice.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/common/ChoiceCheckboxLabel.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/common/InquirerHeader.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/common/InquirerResult.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/common/Shortcut.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/common/__init__.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerWidget.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/__init__.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/__init__.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/common/__init__.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/common/__snapshots__/test_ChoiceLabel/test_snapshot_with_pointer.svg +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/common/__snapshots__/test_ChoiceLabel/test_snapshot_without_pointer.svg +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/common/test_ChoiceLabel.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/test_InquirerApp.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__init__.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerCheckbox/test_snapshot_select_items.svg +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerConfirm/test_snapshot.svg +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerConfirm/test_snapshot_custom_chars.svg +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerConfirm/test_snapshot_default_yes.svg +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerEditor/test_snapshot.svg +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerSelect/test_snapshot_fullscreen.svg +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/__snapshots__/test_InquirerSelect/test_snapshot_mandatory.svg +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerCheckbox.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerConfirm.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerEditor.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerExternal.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerNumber.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerPath.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerSecret.py +0 -0
- {inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/tests/widgets/test_InquirerText.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: inquirer-textual
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Inquirer based on Textual
|
|
5
5
|
Project-URL: Changelog, https://github.com/robvanderleek/inquirer-textual/blob/master/CHANGELOG.md
|
|
6
6
|
Project-URL: Documentation, https://robvanderleek.github.io/inquirer-textual/
|
{inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/docs/getting-started/simple_multi_prompt.py
RENAMED
|
@@ -2,8 +2,8 @@ from inquirer_textual import prompts
|
|
|
2
2
|
from inquirer_textual.widgets.InquirerText import InquirerText
|
|
3
3
|
|
|
4
4
|
if __name__ == "__main__":
|
|
5
|
-
answers = first_name = prompts.multi(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
answers = first_name = prompts.multi({
|
|
6
|
+
'first_name': InquirerText('First name:'),
|
|
7
|
+
'last_name': InquirerText('Last name:')
|
|
8
|
+
})
|
|
9
9
|
print(f'Hello, {answers["first_name"]} {answers["last_name"]}! 👋')
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Output docs/themes/catppuccin_mocha.gif
|
|
2
|
+
Set Shell zsh
|
|
3
|
+
Set Theme { "background": "#000000" }
|
|
4
|
+
Type "uv run examples/themes.py catppuccin-mocha"
|
|
5
|
+
Enter
|
|
6
|
+
Sleep 2s
|
|
7
|
+
Type y
|
|
8
|
+
Sleep 1s
|
|
9
|
+
Type "555-2368"
|
|
10
|
+
Enter
|
|
11
|
+
Sleep 1s
|
|
12
|
+
Enter
|
|
13
|
+
Sleep 1s
|
|
14
|
+
Type "3"
|
|
15
|
+
Enter
|
|
16
|
+
Sleep 1s
|
|
17
|
+
Space
|
|
18
|
+
Down
|
|
19
|
+
Sleep 1s
|
|
20
|
+
Space
|
|
21
|
+
Sleep 1s
|
|
22
|
+
Enter
|
|
23
|
+
Sleep 1s
|
|
24
|
+
Enter
|
|
25
|
+
Sleep 1s
|
|
26
|
+
Enter
|
|
27
|
+
Sleep 3s
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Output docs/themes/nord.gif
|
|
2
|
+
Set Shell zsh
|
|
3
|
+
Set Theme { "background": "#000000" }
|
|
4
|
+
Type "uv run examples/themes.py nord
|
|
5
|
+
Enter
|
|
6
|
+
Sleep 2s
|
|
7
|
+
Type y
|
|
8
|
+
Sleep 1s
|
|
9
|
+
Type "555-2368"
|
|
10
|
+
Enter
|
|
11
|
+
Sleep 1s
|
|
12
|
+
Enter
|
|
13
|
+
Sleep 1s
|
|
14
|
+
Type "3"
|
|
15
|
+
Enter
|
|
16
|
+
Sleep 1s
|
|
17
|
+
Space
|
|
18
|
+
Down
|
|
19
|
+
Sleep 1s
|
|
20
|
+
Space
|
|
21
|
+
Sleep 1s
|
|
22
|
+
Enter
|
|
23
|
+
Sleep 1s
|
|
24
|
+
Enter
|
|
25
|
+
Sleep 1s
|
|
26
|
+
Enter
|
|
27
|
+
Sleep 3s
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Output docs/themes/solarized_light.gif
|
|
2
|
+
Set Shell zsh
|
|
3
|
+
Set Theme { "background": "#000000" }
|
|
4
|
+
Type "uv run examples/themes.py solarized-light"
|
|
5
|
+
Enter
|
|
6
|
+
Sleep 2s
|
|
7
|
+
Type y
|
|
8
|
+
Sleep 1s
|
|
9
|
+
Type "555-2368"
|
|
10
|
+
Enter
|
|
11
|
+
Sleep 1s
|
|
12
|
+
Enter
|
|
13
|
+
Sleep 1s
|
|
14
|
+
Type "3"
|
|
15
|
+
Enter
|
|
16
|
+
Sleep 1s
|
|
17
|
+
Space
|
|
18
|
+
Down
|
|
19
|
+
Sleep 1s
|
|
20
|
+
Space
|
|
21
|
+
Sleep 1s
|
|
22
|
+
Enter
|
|
23
|
+
Sleep 1s
|
|
24
|
+
Enter
|
|
25
|
+
Sleep 1s
|
|
26
|
+
Enter
|
|
27
|
+
Sleep 3s
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Output docs/themes/textual_dark.gif
|
|
2
|
+
Set Shell zsh
|
|
3
|
+
Set Theme { "background": "#000000" }
|
|
4
|
+
Type "uv run examples/themes.py textual-dark"
|
|
5
|
+
Enter
|
|
6
|
+
Sleep 2s
|
|
7
|
+
Type y
|
|
8
|
+
Sleep 1s
|
|
9
|
+
Type "555-2368"
|
|
10
|
+
Enter
|
|
11
|
+
Sleep 1s
|
|
12
|
+
Enter
|
|
13
|
+
Sleep 1s
|
|
14
|
+
Type "3"
|
|
15
|
+
Enter
|
|
16
|
+
Sleep 1s
|
|
17
|
+
Space
|
|
18
|
+
Down
|
|
19
|
+
Sleep 1s
|
|
20
|
+
Space
|
|
21
|
+
Sleep 1s
|
|
22
|
+
Enter
|
|
23
|
+
Sleep 1s
|
|
24
|
+
Enter
|
|
25
|
+
Sleep 1s
|
|
26
|
+
Enter
|
|
27
|
+
Sleep 3s
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Output docs/themes/textual_light.gif
|
|
2
|
+
Set Shell zsh
|
|
3
|
+
Set Theme { "background": "#000000" }
|
|
4
|
+
Type "uv run examples/themes.py textual-light"
|
|
5
|
+
Enter
|
|
6
|
+
Sleep 2s
|
|
7
|
+
Type y
|
|
8
|
+
Sleep 1s
|
|
9
|
+
Type "555-2368"
|
|
10
|
+
Enter
|
|
11
|
+
Sleep 1s
|
|
12
|
+
Enter
|
|
13
|
+
Sleep 1s
|
|
14
|
+
Type "3"
|
|
15
|
+
Enter
|
|
16
|
+
Sleep 1s
|
|
17
|
+
Space
|
|
18
|
+
Down
|
|
19
|
+
Sleep 1s
|
|
20
|
+
Space
|
|
21
|
+
Sleep 1s
|
|
22
|
+
Enter
|
|
23
|
+
Sleep 1s
|
|
24
|
+
Enter
|
|
25
|
+
Sleep 1s
|
|
26
|
+
Enter
|
|
27
|
+
Sleep 3s
|
{inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/examples/alternatives/python-inquirer/main.py
RENAMED
|
@@ -30,5 +30,14 @@ def path():
|
|
|
30
30
|
]
|
|
31
31
|
return inquirer.prompt(questions)
|
|
32
32
|
|
|
33
|
+
def select():
|
|
34
|
+
questions = [
|
|
35
|
+
inquirer.List('size',
|
|
36
|
+
message="What size do you need?",
|
|
37
|
+
choices=['Jumbo', 'Large', 'Standard', 'Medium', 'Small', 'Micro'],
|
|
38
|
+
),
|
|
39
|
+
]
|
|
40
|
+
return inquirer.prompt(questions)
|
|
41
|
+
|
|
33
42
|
if __name__ == "__main__":
|
|
34
|
-
print(
|
|
43
|
+
print(select())
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from textual.validation import Regex
|
|
2
|
+
|
|
3
|
+
from inquirer_textual import prompts
|
|
4
|
+
from inquirer_textual.widgets.InquirerCheckbox import InquirerCheckbox
|
|
5
|
+
from inquirer_textual.widgets.InquirerConfirm import InquirerConfirm
|
|
6
|
+
from inquirer_textual.widgets.InquirerNumber import InquirerNumber
|
|
7
|
+
from inquirer_textual.widgets.InquirerSelect import InquirerSelect
|
|
8
|
+
from inquirer_textual.widgets.InquirerText import InquirerText
|
|
9
|
+
|
|
10
|
+
if __name__ == "__main__":
|
|
11
|
+
print("Hi, welcome to Python Pizza!")
|
|
12
|
+
answers = prompts.multi({
|
|
13
|
+
'toBeDelivered': InquirerConfirm('Is this for delivery?'),
|
|
14
|
+
'phone': InquirerText('What is your phone number?', validators=Regex('\\d+[-]\\d+')),
|
|
15
|
+
'size': InquirerSelect('What size do you need?', ['Large', 'Medium', 'Small']),
|
|
16
|
+
'quantity': InquirerNumber('How many do you need?'),
|
|
17
|
+
'toppings': InquirerCheckbox('What about the toppings?', choices=['Pepperoni', 'Mushrooms', 'Onions']),
|
|
18
|
+
'beverage': InquirerSelect('You also get a free 2L beverage, what would you like?', ["Pepsi", "7up", "Coke"]),
|
|
19
|
+
'comments': InquirerText('Any comments on your purchase experience?', default='Nope, all good!')
|
|
20
|
+
})
|
|
21
|
+
print(answers)
|
|
@@ -5,7 +5,7 @@ from textual.widgets import Label
|
|
|
5
5
|
from textual_slider import Slider
|
|
6
6
|
|
|
7
7
|
from inquirer_textual import prompts
|
|
8
|
-
from inquirer_textual.common.PromptMessage import
|
|
8
|
+
from inquirer_textual.common.PromptMessage import Prompt
|
|
9
9
|
from inquirer_textual.widgets.InquirerWidget import InquirerWidget
|
|
10
10
|
|
|
11
11
|
|
|
@@ -27,7 +27,7 @@ class InquirerSlider(InquirerWidget):
|
|
|
27
27
|
def compose(self) -> ComposeResult:
|
|
28
28
|
with VerticalGroup():
|
|
29
29
|
with HorizontalGroup():
|
|
30
|
-
yield
|
|
30
|
+
yield Prompt(self.message)
|
|
31
31
|
yield Label(id="slider-value")
|
|
32
32
|
yield self.slider
|
|
33
33
|
|
|
@@ -7,12 +7,12 @@ from inquirer_textual.widgets.InquirerSelect import InquirerSelect
|
|
|
7
7
|
from inquirer_textual.widgets.InquirerText import InquirerText
|
|
8
8
|
|
|
9
9
|
if __name__ == '__main__':
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
print(
|
|
10
|
+
answers = prompts.multi({
|
|
11
|
+
'name': InquirerText('Name:'),
|
|
12
|
+
'password': InquirerSecret('Password:'),
|
|
13
|
+
'memory': InquirerNumber('Memory:'),
|
|
14
|
+
'proceed': InquirerConfirm('Proceed?'),
|
|
15
|
+
'planet': InquirerSelect('Planet?', ['Earth', 'Mars', 'Venus'], default='Mars'),
|
|
16
|
+
'people': InquirerCheckbox("People?", choices=['Alice', 'Bob', 'Charlie'])
|
|
17
|
+
})
|
|
18
|
+
print(answers)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
from textual.validation import Regex
|
|
5
|
+
|
|
6
|
+
from inquirer_textual.InquirerApp import InquirerApp
|
|
7
|
+
from inquirer_textual.widgets.InquirerCheckbox import InquirerCheckbox
|
|
8
|
+
from inquirer_textual.widgets.InquirerConfirm import InquirerConfirm
|
|
9
|
+
from inquirer_textual.widgets.InquirerMulti import InquirerMulti
|
|
10
|
+
from inquirer_textual.widgets.InquirerNumber import InquirerNumber
|
|
11
|
+
from inquirer_textual.widgets.InquirerSelect import InquirerSelect
|
|
12
|
+
from inquirer_textual.widgets.InquirerText import InquirerText
|
|
13
|
+
|
|
14
|
+
if __name__ == '__main__':
|
|
15
|
+
TEXTUAL_THEMES = ['textual-dark', 'textual-light', 'nord', 'gruvbox', 'catppuccin-mocha', 'textual-ansi', 'dracula',
|
|
16
|
+
'tokyo-night', 'monokai', 'flexoki', 'catppuccin-latte', 'solarized-light', 'solarized-dark',
|
|
17
|
+
'rose-pine', 'rose-pine-moon', 'rose-pine-dawn', 'atom-one-dark', 'atom-one-light']
|
|
18
|
+
if len(sys.argv) == 0:
|
|
19
|
+
theme = 'inquirer-textual-default'
|
|
20
|
+
elif sys.argv[1] in TEXTUAL_THEMES:
|
|
21
|
+
theme = sys.argv[1]
|
|
22
|
+
else:
|
|
23
|
+
print(f"Theme '{sys.argv[1]}' is not recognized. Available themes are: {', '.join(TEXTUAL_THEMES)}")
|
|
24
|
+
sys.exit(1)
|
|
25
|
+
app: InquirerApp[dict[str, Any]] = InquirerApp(theme=theme)
|
|
26
|
+
app.widget = InquirerMulti({
|
|
27
|
+
'toBeDelivered': InquirerConfirm('Is this for delivery?'),
|
|
28
|
+
'phone': InquirerText('What is your phone number?', validators=Regex('\d+[-]\d+')),
|
|
29
|
+
'size': InquirerSelect('What size do you need?', ['Large', 'Medium', 'Small']),
|
|
30
|
+
'quantity': InquirerNumber('How many do you need?'),
|
|
31
|
+
'toppings': InquirerCheckbox('What about the toppings?', choices=['Pepperoni', 'Mushrooms', 'Onions']),
|
|
32
|
+
'beverage': InquirerSelect('You also get a free 2L beverage, what would you like?', ["Pepsi", "7up", "Coke"]),
|
|
33
|
+
'comments': InquirerText('Any comments on your purchase experience?', default='Nope, all good!')
|
|
34
|
+
})
|
|
35
|
+
answers = app.run().value
|
|
36
|
+
print(answers)
|
|
@@ -12,7 +12,7 @@ from textual.widgets import Footer
|
|
|
12
12
|
from inquirer_textual.common.InquirerHeader import InquirerHeader
|
|
13
13
|
from inquirer_textual.common.InquirerResult import InquirerResult
|
|
14
14
|
from inquirer_textual.common.Shortcut import Shortcut
|
|
15
|
-
from inquirer_textual.common.
|
|
15
|
+
from inquirer_textual.common.defaults import DEFAULT_THEME
|
|
16
16
|
from inquirer_textual.widgets.InquirerWidget import InquirerWidget
|
|
17
17
|
|
|
18
18
|
T = TypeVar('T')
|
|
@@ -20,13 +20,9 @@ T = TypeVar('T')
|
|
|
20
20
|
|
|
21
21
|
class InquirerApp(App[InquirerResult[T]], inherit_bindings=False): # type: ignore[call-arg]
|
|
22
22
|
CSS = """
|
|
23
|
-
App {
|
|
24
|
-
background: black;
|
|
25
|
-
}
|
|
26
23
|
Screen {
|
|
27
24
|
border-top: none;
|
|
28
25
|
border-bottom: none;
|
|
29
|
-
background: transparent;
|
|
30
26
|
height: auto;
|
|
31
27
|
}
|
|
32
28
|
"""
|
|
@@ -36,7 +32,8 @@ class InquirerApp(App[InquirerResult[T]], inherit_bindings=False): # type: igno
|
|
|
36
32
|
Binding("ctrl+d", "quit", "Quit", show=False, priority=True)
|
|
37
33
|
]
|
|
38
34
|
|
|
39
|
-
def __init__(self) -> None:
|
|
35
|
+
def __init__(self, theme: str = 'inquirer-textual-default') -> None:
|
|
36
|
+
self._theme = theme
|
|
40
37
|
self.widget: InquirerWidget | None = None
|
|
41
38
|
self.shortcuts: list[Shortcut] | None = None
|
|
42
39
|
self.header: str | list[str] | None = None
|
|
@@ -48,6 +45,8 @@ class InquirerApp(App[InquirerResult[T]], inherit_bindings=False): # type: igno
|
|
|
48
45
|
super().__init__()
|
|
49
46
|
|
|
50
47
|
def on_mount(self) -> None:
|
|
48
|
+
self.register_theme(DEFAULT_THEME)
|
|
49
|
+
self.theme = self._theme
|
|
51
50
|
self._update_bindings()
|
|
52
51
|
if self.inquiry_func:
|
|
53
52
|
self.run_worker(self.inquiry_func_worker, thread=True)
|
|
@@ -154,9 +153,6 @@ class InquirerApp(App[InquirerResult[T]], inherit_bindings=False): # type: igno
|
|
|
154
153
|
|
|
155
154
|
def get_theme_variable_defaults(self) -> dict[str, str]:
|
|
156
155
|
return {
|
|
157
|
-
'
|
|
158
|
-
'
|
|
159
|
-
'error-color': StandardTheme.error_color,
|
|
160
|
-
'select-list-item-highlight-foreground': StandardTheme.select_list_item_highlight_foreground,
|
|
161
|
-
'select-question-mark': StandardTheme.select_question_mark,
|
|
156
|
+
'inquirer-textual-question-mark': self.current_theme.foreground or 'initial',
|
|
157
|
+
'inquirer-textual-input-color': self.current_theme.foreground or 'initial',
|
|
162
158
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from rich.text import Text
|
|
2
|
+
from textual.app import ComposeResult
|
|
3
|
+
from textual.widget import Widget
|
|
4
|
+
from textual.widgets import Static
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Answer(Widget):
|
|
8
|
+
DEFAULT_CSS = """
|
|
9
|
+
Answer {
|
|
10
|
+
height: auto;
|
|
11
|
+
}
|
|
12
|
+
#inquirer-textual-answer {
|
|
13
|
+
color: $inquirer-textual-input-color;
|
|
14
|
+
}
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, text: str):
|
|
18
|
+
super().__init__()
|
|
19
|
+
self.text = text
|
|
20
|
+
|
|
21
|
+
def compose(self) -> ComposeResult:
|
|
22
|
+
yield Static(Text(self.text), id='inquirer-textual-answer')
|
|
@@ -4,24 +4,24 @@ from rich.text import Text
|
|
|
4
4
|
from textual.widgets import Label
|
|
5
5
|
|
|
6
6
|
from inquirer_textual.common.Choice import Choice
|
|
7
|
-
from inquirer_textual.common.
|
|
7
|
+
from inquirer_textual.common.defaults import DEFAULT_THEME, POINTER_CHARACTER
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class ChoiceLabel(Label):
|
|
11
11
|
def __init__(self, item: str | Choice, pattern: str | None = None):
|
|
12
|
-
self._text =
|
|
12
|
+
self._text = self._get_text(item, pattern)
|
|
13
13
|
super().__init__(Text(' ').append_text(self._text))
|
|
14
14
|
self.item = item
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
def _get_text(cls, item: str | Choice, pattern: str | None = None) -> Text:
|
|
16
|
+
def _get_text(self, item: str | Choice, pattern: str | None = None) -> Text:
|
|
18
17
|
result = Text(item if isinstance(item, str) else item.name)
|
|
19
18
|
if pattern:
|
|
20
|
-
result.highlight_words([pattern], style=
|
|
19
|
+
result.highlight_words([pattern], style=self.app.current_theme.accent or DEFAULT_THEME.accent,
|
|
20
|
+
case_sensitive=False)
|
|
21
21
|
return result
|
|
22
22
|
|
|
23
23
|
def add_pointer(self):
|
|
24
|
-
self.update(Text(f'{
|
|
24
|
+
self.update(Text(f'{POINTER_CHARACTER} ').append_text(self._text))
|
|
25
25
|
|
|
26
26
|
def remove_pointer(self):
|
|
27
27
|
self.update(Text(' ').append_text(self._text))
|
|
@@ -4,9 +4,9 @@ from textual.widget import Widget
|
|
|
4
4
|
from textual.widgets import Static, Label
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class Prompt(Widget):
|
|
8
8
|
DEFAULT_CSS = """
|
|
9
|
-
|
|
9
|
+
Prompt {
|
|
10
10
|
width: auto;
|
|
11
11
|
height: auto;
|
|
12
12
|
}
|
|
@@ -16,7 +16,7 @@ class PromptMessage(Widget):
|
|
|
16
16
|
}
|
|
17
17
|
#prompt-message-question-mark {
|
|
18
18
|
width: auto;
|
|
19
|
-
color: $
|
|
19
|
+
color: $inquirer-textual-question-mark;
|
|
20
20
|
}
|
|
21
21
|
"""
|
|
22
22
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from textual.theme import Theme
|
|
2
|
+
|
|
3
|
+
DEFAULT_THEME = Theme(
|
|
4
|
+
name="inquirer-textual-default",
|
|
5
|
+
primary="#0178D4",
|
|
6
|
+
secondary="#004578",
|
|
7
|
+
accent="#c678dd",
|
|
8
|
+
warning="#ffa62b",
|
|
9
|
+
error="#e06c75",
|
|
10
|
+
success="#4EBF71",
|
|
11
|
+
foreground="#e0e0e0",
|
|
12
|
+
background="black",
|
|
13
|
+
surface="transparent",
|
|
14
|
+
variables={
|
|
15
|
+
'block-cursor-foreground': '#61afef',
|
|
16
|
+
'block-cursor-background': 'transparent',
|
|
17
|
+
'block-cursor-blurred-foreground': '#61afef',
|
|
18
|
+
'block-cursor-blurred-background': 'transparent',
|
|
19
|
+
'inquirer-textual-question-mark': '#e5c07b',
|
|
20
|
+
'inquirer-textual-input-color': '#98c379',
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
POINTER_CHARACTER = '\u276f'
|
|
@@ -42,7 +42,7 @@ def external(widget: InquirerWidget, clear: bool = False) -> Any:
|
|
|
42
42
|
return app.run(inline=True, inline_no_clear=not clear).value
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
def multi(widgets:
|
|
45
|
+
def multi(widgets: dict[str, InquirerWidget], clear: bool = False) -> dict[str, Any]:
|
|
46
46
|
app: InquirerApp[dict[str, Any]] = InquirerApp()
|
|
47
47
|
app.widget = InquirerMulti(widgets)
|
|
48
48
|
return app.run(inline=True, inline_no_clear=not clear).value
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
version = "0.4.0"
|
{inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerCheckbox.py
RENAMED
|
@@ -2,27 +2,19 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from textual.app import ComposeResult
|
|
4
4
|
from textual.containers import VerticalGroup, HorizontalGroup
|
|
5
|
-
from textual.widgets import ListItem, ListView
|
|
5
|
+
from textual.widgets import ListItem, ListView
|
|
6
6
|
from typing_extensions import Self
|
|
7
7
|
|
|
8
|
+
from inquirer_textual.common.Answer import Answer
|
|
8
9
|
from inquirer_textual.common.Choice import Choice
|
|
9
10
|
from inquirer_textual.common.ChoiceCheckboxLabel import ChoiceCheckboxLabel
|
|
10
|
-
from inquirer_textual.common.
|
|
11
|
+
from inquirer_textual.common.Prompt import Prompt
|
|
11
12
|
from inquirer_textual.widgets.InquirerWidget import InquirerWidget
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class InquirerCheckbox(InquirerWidget):
|
|
15
16
|
"""A checkbox widget that allows multiple selections from a list of choices."""
|
|
16
17
|
|
|
17
|
-
DEFAULT_CSS = """
|
|
18
|
-
#inquirer-checkbox-list-view {
|
|
19
|
-
background: transparent;
|
|
20
|
-
}
|
|
21
|
-
#inquirer-checkbox-list-view ListItem.-highlight {
|
|
22
|
-
color: $select-list-item-highlight-foreground;
|
|
23
|
-
background: transparent;
|
|
24
|
-
}
|
|
25
|
-
"""
|
|
26
18
|
BINDINGS = [
|
|
27
19
|
("space", "toggle_selected", "Toggle selection"),
|
|
28
20
|
]
|
|
@@ -81,8 +73,8 @@ class InquirerCheckbox(InquirerWidget):
|
|
|
81
73
|
def compose(self) -> ComposeResult:
|
|
82
74
|
if self.show_selected_value:
|
|
83
75
|
with HorizontalGroup():
|
|
84
|
-
yield
|
|
85
|
-
yield
|
|
76
|
+
yield Prompt(self.message)
|
|
77
|
+
yield Answer(str(self.selected_value))
|
|
86
78
|
else:
|
|
87
79
|
with VerticalGroup():
|
|
88
80
|
items: list[ListItem] = []
|
|
@@ -90,5 +82,5 @@ class InquirerCheckbox(InquirerWidget):
|
|
|
90
82
|
list_item = ListItem(ChoiceCheckboxLabel(choice))
|
|
91
83
|
items.append(list_item)
|
|
92
84
|
self.list_view = ListView(*items, id='inquirer-checkbox-list-view')
|
|
93
|
-
yield
|
|
85
|
+
yield Prompt(self.message)
|
|
94
86
|
yield self.list_view
|
{inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerConfirm.py
RENAMED
|
@@ -5,7 +5,8 @@ from textual.app import ComposeResult
|
|
|
5
5
|
from textual.containers import HorizontalGroup
|
|
6
6
|
from textual.widgets import Label
|
|
7
7
|
|
|
8
|
-
from inquirer_textual.common.
|
|
8
|
+
from inquirer_textual.common.Answer import Answer
|
|
9
|
+
from inquirer_textual.common.Prompt import Prompt
|
|
9
10
|
from inquirer_textual.widgets.InquirerWidget import InquirerWidget
|
|
10
11
|
|
|
11
12
|
|
|
@@ -36,26 +37,41 @@ class InquirerConfirm(InquirerWidget):
|
|
|
36
37
|
if confirm_character.lower() == reject_character.lower():
|
|
37
38
|
raise ValueError("confirm_character and reject_character must be different")
|
|
38
39
|
self.message = message
|
|
40
|
+
self.confirm_character = confirm_character
|
|
41
|
+
self.reject_character = reject_character
|
|
39
42
|
c = confirm_character if not default else confirm_character.upper()
|
|
40
43
|
r = reject_character if default else reject_character.upper()
|
|
41
44
|
self.label = Label(f'({c}/{r})')
|
|
42
45
|
self.value: bool = default
|
|
46
|
+
self.selected_value: bool | None = None
|
|
47
|
+
self.show_selected_value: bool = False
|
|
43
48
|
|
|
44
49
|
def on_key(self, event: events.Key):
|
|
45
50
|
if event.key.lower() == 'y':
|
|
46
51
|
self.value = True
|
|
47
|
-
self.
|
|
52
|
+
self.submit_current_value()
|
|
48
53
|
elif event.key.lower() == 'n':
|
|
49
54
|
self.value = False
|
|
50
|
-
self.
|
|
55
|
+
self.submit_current_value()
|
|
51
56
|
elif event.key == 'enter':
|
|
52
57
|
event.stop()
|
|
53
|
-
self.
|
|
58
|
+
self.submit_current_value()
|
|
54
59
|
|
|
55
60
|
def current_value(self):
|
|
56
61
|
return self.value
|
|
57
62
|
|
|
63
|
+
async def set_selected_value(self, value: bool) -> None:
|
|
64
|
+
self.selected_value = value
|
|
65
|
+
self.styles.height = 1
|
|
66
|
+
self.show_selected_value = True
|
|
67
|
+
await self.recompose()
|
|
68
|
+
|
|
58
69
|
def compose(self) -> ComposeResult:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
if self.show_selected_value:
|
|
71
|
+
with HorizontalGroup():
|
|
72
|
+
yield Prompt(self.message)
|
|
73
|
+
yield Answer(self.confirm_character if self.selected_value else self.reject_character)
|
|
74
|
+
else:
|
|
75
|
+
with HorizontalGroup():
|
|
76
|
+
yield Prompt(self.message)
|
|
77
|
+
yield self.label
|
{inquirer_textual-0.3.0 → inquirer_textual-0.4.0}/inquirer_textual/widgets/InquirerEditor.py
RENAMED
|
@@ -8,7 +8,7 @@ from textual.app import ComposeResult
|
|
|
8
8
|
from textual.containers import HorizontalGroup
|
|
9
9
|
from textual.widgets import Static
|
|
10
10
|
|
|
11
|
-
from inquirer_textual.common.
|
|
11
|
+
from inquirer_textual.common.Prompt import Prompt
|
|
12
12
|
from inquirer_textual.widgets.InquirerWidget import InquirerWidget
|
|
13
13
|
|
|
14
14
|
|
|
@@ -54,7 +54,7 @@ class InquirerEditor(InquirerWidget):
|
|
|
54
54
|
def compose(self) -> ComposeResult:
|
|
55
55
|
if self.message:
|
|
56
56
|
with HorizontalGroup():
|
|
57
|
-
yield
|
|
57
|
+
yield Prompt(self.message)
|
|
58
58
|
yield Static('[dim]Press <enter> to launch editor[/dim]')
|
|
59
59
|
else:
|
|
60
60
|
super().compose()
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from textual.app import ComposeResult
|
|
4
|
+
|
|
5
|
+
from inquirer_textual.widgets.InquirerWidget import InquirerWidget
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class InquirerMulti(InquirerWidget):
|
|
9
|
+
"""A prompt that allows the user to answer multiple prompts in sequence."""
|
|
10
|
+
|
|
11
|
+
DEFAULT_CSS = """
|
|
12
|
+
InquirerMulti {
|
|
13
|
+
height: auto;
|
|
14
|
+
}
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, widgets: dict[str, InquirerWidget]) -> None:
|
|
18
|
+
"""
|
|
19
|
+
Args:
|
|
20
|
+
widgets (dict[str, InquirerWidget]): A dictionary of InquirerWidget instances to present in sequence of definition.
|
|
21
|
+
"""
|
|
22
|
+
super().__init__()
|
|
23
|
+
self.widgets = widgets
|
|
24
|
+
self._current_widget_index = 0
|
|
25
|
+
self._return_values_dict: dict[str, Any] = {}
|
|
26
|
+
|
|
27
|
+
async def on_inquirer_widget_submit(self, message: InquirerWidget.Submit) -> None:
|
|
28
|
+
current_item = list(self.widgets.items())[self._current_widget_index]
|
|
29
|
+
self._return_values_dict[current_item[0]] = message.value
|
|
30
|
+
await current_item[1].set_selected_value(message.value)
|
|
31
|
+
self._current_widget_index += 1
|
|
32
|
+
if self._current_widget_index < len(self.widgets):
|
|
33
|
+
message.stop()
|
|
34
|
+
next_widget = self.query_one(f'#widget-{self._current_widget_index}')
|
|
35
|
+
next_widget.styles.display = 'block'
|
|
36
|
+
next_widget.focus()
|
|
37
|
+
else:
|
|
38
|
+
message.value = self._return_values_dict
|
|
39
|
+
|
|
40
|
+
def compose(self) -> ComposeResult:
|
|
41
|
+
for idx, item in enumerate(self.widgets.items()):
|
|
42
|
+
item[1].id = f'widget-{idx}'
|
|
43
|
+
if idx > 0:
|
|
44
|
+
item[1].styles.display = 'none'
|
|
45
|
+
yield item[1]
|