summaryrefslogtreecommitdiff
path: root/cmd2/exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* Some mypy validation fixesEric Lin2021-03-181-2/+5
|
* Added cmd2.exceptions.PassThroughExceptionexception_passthroughKevin Van Brunt2021-03-021-0/+15
|
* Start making small changes to fix mypy warningsTodd Leonhardt2021-02-211-2/+2
|
* Fixed black, isort, flake8, and doc8 issuesTodd Leonhardt2021-02-191-0/+2
|
* Merge branch 'master' into blackTodd Leonhardt2021-02-191-0/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # cmd2/__init__.py # cmd2/argparse_completer.py # cmd2/argparse_custom.py # cmd2/cmd2.py # cmd2/decorators.py # cmd2/exceptions.py # cmd2/utils.py # examples/arg_decorators.py # examples/argparse_completion.py # examples/modular_commands_main.py # tests/test_argparse_completer.py # tests/test_argparse_custom.py # tests/test_cmd2.py # tests/test_completion.py # tests/test_history.py
| * Replaced choices_function / choices_method with choices_provider.Kevin Van Brunt2020-08-131-0/+25
| | | | | | | | | | | | | | | | | | Replaced completer_function / completer_method with completer. ArgparseCompleter now always passes cmd2.Cmd or CommandSet instance as the self argument to choices_provider and completer functions. Moved basic_complete from utils into cmd2.Cmd class. Moved CompletionError to exceptions.py
* | Add black for automatic code formatTodd Leonhardt2021-01-311-0/+9
|/
* Verify that a completer function is defined in a CommandSet beforeEric Lin2020-08-061-0/+4
| | | | | | | | | | passing it a CommandSet instance. Search for a CommandSet instance that matches the completer's parent class type.` Resolves Issue #967 Renamed isolated_tests directory to tests_isolated for better visual grouping. Added some exception documentation
* Minor formatting fixes. Injecting a function into namespace objects before ↵Eric Lin2020-08-041-0/+1
| | | | passing to command handlers to access sub-command handlers
* Now maintains a command->CommandSet mapping and passes the CommandSetanselor2020-08-041-0/+3
| | | | | | | | | | | | | | | through to the ArgparseCompleter if one is registered. For subcommands, the registered argparse instance for the subcommand is now tagged with the CommandSet from which it originated. If a CommandSet is detected, it's now passed in as 'self' for the completion functions. Fixes some issue found with removing a subcommand. Adds additional tests. Added a check to prevent removal of a CommandSet if it has commands with sub-commands from another CommandSet bound to it. Documentation improvements. Standardized around using CommandSetRegistrationException during commandset install/uninstall related errors. Added support for nested sub-command injection.
* Made following changes to onecmd_plus_hooks()Kevin Van Brunt2020-05-071-4/+4
| | | | | 1. Added SystemExit handling by warning the user it's occured and setting stop to True 2. KeyboardInterrupts won't be raised if stop is already set to True.
* Added SkipPostcommandHooks exception and made Cmd2ArgparseError inherit from it.Kevin Van Brunt2020-05-071-5/+22
| | | | Both exception classes have been added to the public API.
* Simplfied _redirect_output() by raising exception instead of returning boolKevin Van Brunt2020-04-111-0/+5
|
* Added Cmd2ShlexErrorKevin Van Brunt2020-03-121-2/+11
|
* Changed name of exception class as requested in code reviewKevin Van Brunt2020-03-051-2/+2
|
* Prevent postcmd_hook from running when argparse failsKevin Van Brunt2020-03-051-0/+5
|
* Oops forgot to commit a fileTodd Leonhardt2020-02-181-0/+12