cmd2 4.1.0__tar.gz → 4.1.2__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.
- {cmd2-4.1.0 → cmd2-4.1.2}/.pre-commit-config.yaml +2 -2
- {cmd2-4.1.0 → cmd2-4.1.2}/CHANGELOG.md +13 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/PKG-INFO +1 -1
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/argparse_utils.py +3 -3
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/cmd2.py +39 -21
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/utils.py +6 -3
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/PKG-INFO +1 -1
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/SOURCES.txt +0 -1
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/scm_file_list.json +185 -185
- cmd2-4.1.2/cmd2.egg-info/scm_version.json +8 -0
- cmd2-4.1.2/examples/async_printing.py +181 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/default_categories.py +6 -7
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/getting_started.py +28 -25
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/hello_cmd2.py +2 -2
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_cmd2.py +97 -8
- cmd2-4.1.0/cmd2.egg-info/scm_version.json +0 -8
- cmd2-4.1.0/examples/async_printing.py +0 -182
- cmd2-4.1.0/examples/cmd2_history.dat +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/.prettierignore +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/.prettierrc +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/.typos.toml +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/GEMINI.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/LICENSE +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/MANIFEST.in +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/Makefile +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/README.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/__init__.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/annotated.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/argparse_completer.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/clipboard.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/colors.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/command_set.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/completion.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/constants.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/decorators.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/exceptions.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/history.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/parsing.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/plugin.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/pt_utils.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/py.typed +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/py_bridge.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/rich_utils.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/string_utils.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/styles.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/theme.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/types.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/dependency_links.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/requires.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/top_level.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.png +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/codecov.yml +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/annotated.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/argparse_completer.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/argparse_utils.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/clipboard.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/cmd.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/colors.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/command_set.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/completion.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/constants.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/decorators.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/exceptions.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/history.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/index.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/parsing.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/plugin.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/pt_utils.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/py_bridge.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/rich_utils.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/string_utils.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/styles.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/theme.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/utils.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/doc_conventions.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/examples/alternate_event_loops.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/examples/examples.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/examples/getting_started.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/examples/index.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/annotated.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/argument_processing.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/async_commands.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/builtin_commands.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/clipboard.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/commands.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/completion.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/disable_commands.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/embedded_python_shells.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/generating_output.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/help.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/history.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/hooks.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/index.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/initialization.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/misc.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/modular_commands.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/multiline_commands.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/os.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/packaging.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/plugins.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/prompt.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/redirection.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/scripting.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/settings.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/shortcuts_aliases_macros.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/startup_commands.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/table_creation.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/theme.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/index.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/javascripts/readthedocs.js +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/migrating/incompatibilities.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/migrating/index.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/migrating/minimum.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/migrating/next_steps.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/migrating/why.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/mixins/index.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/mixins/mixin_template.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/overrides/main.html +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/overview/alternatives.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/overview/index.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/overview/installation.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/overview/integrating.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/overview/resources.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/stylesheets/cmd2.css +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/testing.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/docs/upgrades.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/.cmd2rc +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/README.md +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/annotated_example.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/argparse_completion.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/argparse_example.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/async_call.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/async_commands.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/basic_completion.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/cmd_as_argument.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/color.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/command_sets.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/completion_item_choices.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/custom_parser.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/custom_types.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/dynamic_commands.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/environment.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/event_loops.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/exit_code.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/help_categories.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/hooks.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/migrating.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/mixin.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/modular_commands/__init__.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/modular_commands/commandset_basic.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/modular_commands/commandset_complex.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/modular_commands/commandset_custominit.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/modular_commandsets.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/paged_output.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/persistent_history.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/pretty_print.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/python_scripting.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/read_input.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/remove_builtin_commands.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/remove_settable.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/rich_tables.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/rich_theme.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/arg_printer.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/conditional.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/nested.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/quit.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/save_help_text.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/script.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/script.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/tmux_launch.sh +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/tmux_split.sh +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/examples/unicode_commands.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/mkdocs.yml +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/package.json +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/pyproject.toml +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/ruff.toml +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/scripts/validate_tag.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/setup.cfg +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/.cmd2rc +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/__init__.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/conftest.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/echo.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/environment.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/help.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/py_locals.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/pyscript_dir.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/raises_exception.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/recursive.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/self_in_py.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/stop.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/test_print.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/relative_multiple.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/script.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/script.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/binary.bin +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/empty.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/help.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/nested.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/one_down.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/postcmds.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/precmds.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/utf8.txt +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_annotated.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_argparse.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_argparse_completer.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_argparse_subcommands.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_argparse_utils.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_categories.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_commandset.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_completion.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_dynamic_complete_style.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_future_annotations.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_history.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_parsing.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_plugin.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_pt_utils.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_py_completion.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_rich_utils.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_run_pyscript.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_string_utils.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_theme.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_utils.py +0 -0
- {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_utils_defining_class.py +0 -0
|
@@ -14,7 +14,7 @@ repos:
|
|
|
14
14
|
- id: trailing-whitespace
|
|
15
15
|
|
|
16
16
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
17
|
-
rev: "v0.15.
|
|
17
|
+
rev: "v0.15.21"
|
|
18
18
|
hooks:
|
|
19
19
|
- id: ruff-format
|
|
20
20
|
args: [--config=ruff.toml]
|
|
@@ -30,7 +30,7 @@ repos:
|
|
|
30
30
|
- prettier-plugin-toml@2.0.6
|
|
31
31
|
|
|
32
32
|
- repo: https://github.com/crate-ci/typos
|
|
33
|
-
rev: v1.
|
|
33
|
+
rev: v1.48.0
|
|
34
34
|
hooks:
|
|
35
35
|
- id: typos
|
|
36
36
|
exclude: |
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## 4.1.2 (July 16, 2026)
|
|
2
|
+
|
|
3
|
+
- Enhancements
|
|
4
|
+
- Added possibility to use rich Text objects to set the description argument of a `Settable`
|
|
5
|
+
- Removed redundant `ipython` import which slowed application startup time
|
|
6
|
+
|
|
7
|
+
## 4.1.1 (July 9, 2026)
|
|
8
|
+
|
|
9
|
+
- Bug Fixes
|
|
10
|
+
- Fixed a couple type issues that emerged with the upgrade to `mypy` 2.2.0
|
|
11
|
+
- Enhancements
|
|
12
|
+
- Async alert messages can now be Rich renderables.
|
|
13
|
+
|
|
1
14
|
## 4.1.0 (July 7, 2026)
|
|
2
15
|
|
|
3
16
|
- Breaking Changes
|
|
@@ -1035,13 +1035,13 @@ class Cmd2ArgumentParser(argparse.ArgumentParser):
|
|
|
1035
1035
|
|
|
1036
1036
|
self.exit(2, f"{formatted_message}\n")
|
|
1037
1037
|
|
|
1038
|
-
def _get_formatter(self, **_kwargs: Any) -> Cmd2HelpFormatter:
|
|
1038
|
+
def _get_formatter(self, *_args: Any, **_kwargs: Any) -> Cmd2HelpFormatter:
|
|
1039
1039
|
"""Override with customizations for Cmd2HelpFormatter."""
|
|
1040
1040
|
return self.formatter_class(prog=self.prog, file=self._thread_locals.current_output_file)
|
|
1041
1041
|
|
|
1042
|
-
def format_help(self) -> str:
|
|
1042
|
+
def format_help(self, *args: Any, **kwargs: Any) -> str:
|
|
1043
1043
|
"""Override to add a newline."""
|
|
1044
|
-
return super().format_help() + "\n"
|
|
1044
|
+
return super().format_help(*args, **kwargs) + "\n"
|
|
1045
1045
|
|
|
1046
1046
|
def _get_nargs_pattern(self, action: argparse.Action) -> str:
|
|
1047
1047
|
"""Override to support nargs ranges."""
|
|
@@ -177,9 +177,6 @@ from .types import (
|
|
|
177
177
|
UnboundCompleter,
|
|
178
178
|
)
|
|
179
179
|
|
|
180
|
-
with contextlib.suppress(ImportError):
|
|
181
|
-
from IPython import start_ipython
|
|
182
|
-
|
|
183
180
|
try:
|
|
184
181
|
if sys.platform == "win32":
|
|
185
182
|
from prompt_toolkit.output.win32 import NoConsoleScreenBufferError # type: ignore[attr-defined]
|
|
@@ -312,7 +309,11 @@ class CommandParsers:
|
|
|
312
309
|
class AsyncAlert:
|
|
313
310
|
"""Contents of an asynchronous alert which display while user is at prompt.
|
|
314
311
|
|
|
315
|
-
:param msg: an optional
|
|
312
|
+
:param msg: an optional printable object (including Rich renderables) to be
|
|
313
|
+
printed above the prompt.
|
|
314
|
+
:param soft_wrap: Enable soft wrap mode. This only applies with msg is not None.
|
|
315
|
+
Defaults to True. See print_to() docstring for more details on
|
|
316
|
+
this parameter.
|
|
316
317
|
:param prompt: an optional string to dynamically replace the current prompt.
|
|
317
318
|
|
|
318
319
|
:ivar timestamp: monotonic creation time of the alert. If an alert was created
|
|
@@ -320,7 +321,8 @@ class AsyncAlert:
|
|
|
320
321
|
to avoid a stale display, but its msg data will still be displayed.
|
|
321
322
|
"""
|
|
322
323
|
|
|
323
|
-
msg:
|
|
324
|
+
msg: Any | None = None
|
|
325
|
+
soft_wrap: bool = True
|
|
324
326
|
prompt: str | None = None
|
|
325
327
|
timestamp: float = field(default_factory=time.monotonic, init=False)
|
|
326
328
|
|
|
@@ -1377,7 +1379,7 @@ class Cmd:
|
|
|
1377
1379
|
Settable(
|
|
1378
1380
|
"allow_style",
|
|
1379
1381
|
allow_style_type,
|
|
1380
|
-
|
|
1382
|
+
settable_description,
|
|
1381
1383
|
self,
|
|
1382
1384
|
choices_provider=get_allow_style_choices,
|
|
1383
1385
|
)
|
|
@@ -1394,7 +1396,7 @@ class Cmd:
|
|
|
1394
1396
|
Settable(
|
|
1395
1397
|
"editor",
|
|
1396
1398
|
str,
|
|
1397
|
-
|
|
1399
|
+
editor_description,
|
|
1398
1400
|
self,
|
|
1399
1401
|
)
|
|
1400
1402
|
)
|
|
@@ -1429,7 +1431,7 @@ class Cmd:
|
|
|
1429
1431
|
Settable(
|
|
1430
1432
|
"traceback_width",
|
|
1431
1433
|
utils.optional_int,
|
|
1432
|
-
|
|
1434
|
+
traceback_width_description,
|
|
1433
1435
|
self,
|
|
1434
1436
|
)
|
|
1435
1437
|
)
|
|
@@ -1572,7 +1574,7 @@ class Cmd:
|
|
|
1572
1574
|
If False, Rich wraps text to fit the terminal width.
|
|
1573
1575
|
Set this to False when printing structured Renderables like
|
|
1574
1576
|
Tables, Panels, or Columns to ensure they render as expected.
|
|
1575
|
-
For example, when soft_wrap is True Panels truncate text
|
|
1577
|
+
For example, when soft_wrap is True, Panels truncate text
|
|
1576
1578
|
which is wider than the terminal.
|
|
1577
1579
|
:param justify: justify method ("left", "center", "right", "full"). Defaults to None.
|
|
1578
1580
|
:param emoji: If True, Rich will replace emoji codes (e.g., :smiley:) with their
|
|
@@ -3657,7 +3659,19 @@ class Cmd:
|
|
|
3657
3659
|
# prevents async alerts from printing once a command starts.
|
|
3658
3660
|
|
|
3659
3661
|
# Print all alerts at once to reduce flicker.
|
|
3660
|
-
|
|
3662
|
+
console = self._get_core_print_console(
|
|
3663
|
+
file=self.stdout,
|
|
3664
|
+
emoji=False,
|
|
3665
|
+
markup=False,
|
|
3666
|
+
highlight=False,
|
|
3667
|
+
)
|
|
3668
|
+
|
|
3669
|
+
with console.capture() as capture:
|
|
3670
|
+
for alert in self._alert_queue:
|
|
3671
|
+
if alert.msg is not None:
|
|
3672
|
+
console.print(alert.msg, soft_wrap=alert.soft_wrap)
|
|
3673
|
+
|
|
3674
|
+
alert_text = capture.get()
|
|
3661
3675
|
|
|
3662
3676
|
# Find the latest prompt update among all pending alerts.
|
|
3663
3677
|
latest_prompt = None
|
|
@@ -3681,7 +3695,7 @@ class Cmd:
|
|
|
3681
3695
|
if alert_text:
|
|
3682
3696
|
# Print the alert messages above the prompt.
|
|
3683
3697
|
with patch_stdout():
|
|
3684
|
-
print_formatted_text(
|
|
3698
|
+
print_formatted_text(ANSI(alert_text), end="")
|
|
3685
3699
|
|
|
3686
3700
|
elif latest_prompt is not None:
|
|
3687
3701
|
# Refresh UI immediately to show the new prompt
|
|
@@ -5134,13 +5148,7 @@ class Cmd:
|
|
|
5134
5148
|
# Detect whether IPython is installed
|
|
5135
5149
|
try:
|
|
5136
5150
|
import traitlets.config.loader as traitlets_loader
|
|
5137
|
-
|
|
5138
|
-
# Allow users to install ipython from a cmd2 prompt when needed and still have ipy command work
|
|
5139
|
-
try:
|
|
5140
|
-
_dummy = start_ipython # noqa: F823
|
|
5141
|
-
except NameError:
|
|
5142
|
-
from IPython import start_ipython
|
|
5143
|
-
|
|
5151
|
+
from IPython import start_ipython
|
|
5144
5152
|
from IPython.terminal.interactiveshell import TerminalInteractiveShell
|
|
5145
5153
|
from IPython.terminal.ipapp import TerminalIPythonApp
|
|
5146
5154
|
except ImportError:
|
|
@@ -5616,7 +5624,13 @@ class Cmd:
|
|
|
5616
5624
|
# self.last_result will be set by do_run_script()
|
|
5617
5625
|
return self.do_run_script(su.quote(relative_path))
|
|
5618
5626
|
|
|
5619
|
-
def add_alert(
|
|
5627
|
+
def add_alert(
|
|
5628
|
+
self,
|
|
5629
|
+
*,
|
|
5630
|
+
msg: Any | None = None,
|
|
5631
|
+
soft_wrap: bool = True,
|
|
5632
|
+
prompt: str | None = None,
|
|
5633
|
+
) -> None:
|
|
5620
5634
|
"""Queue an asynchronous alert to be displayed when the prompt is active.
|
|
5621
5635
|
|
|
5622
5636
|
Examples:
|
|
@@ -5624,7 +5638,11 @@ class Cmd:
|
|
|
5624
5638
|
add_alert(prompt="user@host> ") # Update prompt only
|
|
5625
5639
|
add_alert(msg="Done", prompt="> ") # Update both
|
|
5626
5640
|
|
|
5627
|
-
:param msg: an optional
|
|
5641
|
+
:param msg: an optional printable object (including Rich renderables) to be
|
|
5642
|
+
printed above the prompt.
|
|
5643
|
+
:param soft_wrap: Enable soft wrap mode. This only applies with msg is not None.
|
|
5644
|
+
Defaults to True. See print_to() docstring for more details on
|
|
5645
|
+
this parameter.
|
|
5628
5646
|
:param prompt: an optional string to dynamically replace the current prompt.
|
|
5629
5647
|
|
|
5630
5648
|
"""
|
|
@@ -5632,7 +5650,7 @@ class Cmd:
|
|
|
5632
5650
|
return
|
|
5633
5651
|
|
|
5634
5652
|
with self._alert_condition:
|
|
5635
|
-
alert = AsyncAlert(msg=msg, prompt=prompt)
|
|
5653
|
+
alert = AsyncAlert(msg=msg, soft_wrap=soft_wrap, prompt=prompt)
|
|
5636
5654
|
self._alert_queue.append(alert)
|
|
5637
5655
|
self._alert_condition.notify_all()
|
|
5638
5656
|
|
|
@@ -25,7 +25,10 @@ from typing import (
|
|
|
25
25
|
cast,
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
+
from rich.text import Text
|
|
29
|
+
|
|
28
30
|
from . import constants
|
|
31
|
+
from . import rich_utils as ru
|
|
29
32
|
from . import string_utils as su
|
|
30
33
|
from .types import (
|
|
31
34
|
CmdOrSet,
|
|
@@ -88,7 +91,7 @@ class Settable:
|
|
|
88
91
|
self,
|
|
89
92
|
name: str,
|
|
90
93
|
val_type: type[Any] | Callable[[Any], Any],
|
|
91
|
-
description: str,
|
|
94
|
+
description: str | Text,
|
|
92
95
|
settable_object: object,
|
|
93
96
|
*,
|
|
94
97
|
settable_attrib_name: str | None = None,
|
|
@@ -108,7 +111,7 @@ class Settable:
|
|
|
108
111
|
input is a valid integer. Specifying bool automatically provides
|
|
109
112
|
completion for 'true' and 'false' and uses a built-in function
|
|
110
113
|
for conversion and validation.
|
|
111
|
-
:param description: A concise string that describes the purpose of this setting.
|
|
114
|
+
:param description: A concise string or rich Text object that describes the purpose of this setting.
|
|
112
115
|
:param settable_object: The object that owns the attribute being made settable (e.g. self).
|
|
113
116
|
:param settable_attrib_name: The name of the attribute on the settable_object that
|
|
114
117
|
will be modified. This defaults to the value of the name
|
|
@@ -142,7 +145,7 @@ class Settable:
|
|
|
142
145
|
|
|
143
146
|
self.name = name
|
|
144
147
|
self.val_type = val_type
|
|
145
|
-
self.description = description
|
|
148
|
+
self.description = ru.rich_text_to_string(description) if isinstance(description, Text) else description
|
|
146
149
|
self.settable_obj = settable_object
|
|
147
150
|
self.settable_attrib_name = settable_attrib_name if settable_attrib_name is not None else name
|
|
148
151
|
self.onchange_cb = onchange_cb
|