summaryrefslogtreecommitdiff
path: root/cmd2/exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* Adds pre-commit config to run various lintersci_improvementsxNinjaKittyx2020-12-151-0/+9
| | | | | | | This ads black, isort, pyupgrade, and flake8 to pre-commit-config.yaml There are also some small changes to travis.yml and tasks.py to reduce some repeated configurations that should be consolidated into setup.cfg. Most other changes are automated by the linter scripts.
* 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