| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
implementation as an option to with_argparser instead.
|
|
|
|
|
|
|
| |
Also:
- Added isort to Pipenv dev
- Added setup.cfg to make it easy to run flake8, doc8, and isort directly from the command line without using invoke
- Ran isort to sort includes
|
| |
|
| |
|
|
|
|
| |
omitted. Instead allow argparse to handle the error.
|
|
|
|
|
|
| |
BASE_HELP_VERBOSE constants
The tests are now much more resilient to adding, removing, or renaming commands
|
| |
|
| |
|
|
|
|
| |
True for stop
|
| |
|
|
|
|
| |
allow_cli_args is now an argument to __init__ instead of a cmd2 class member
|
| |
|
|
|
|
| |
year
|
|
|
|
| |
to present a better error message to user
|
|
|
|
| |
printed in failure cases
|
|
|
|
|
|
|
|
|
|
|
|
| |
cmd2.Cmd.cmdloop() now returns self.exit_code which should be an integer
Also:
- Refactored examples to call sys.exit(app.cmdloop()) in their __main__
- Running transcript tests now sets the exit_code accordingly based on success/failure
- Updated CHANGELOG
- Updated README
- Updated Sphinx docs
- Added unit test for case when transcript test fails
|
|
|
|
| |
load commands
|
|
|
|
|
|
| |
Also:
- Removed guard clauses which kmvanbrunt promises will be unecessary with his upcoming change
- Moved transcript path validation inside _generate_transcript()
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The following are now arguments to cmd2.Cmd.__init__() instead of class attributes:
* allow_redirection
* multiline_commands
* terminators
* shortcuts
Added a couple read-only properties for convenience of cmd2.Cmd accessing immutable members from self.statement_parser
|
|/ |
|
| |
|
|
|
|
| |
calling init()
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit contains a very large number of trivial changes in order to fix flake8 errors and warnings. Predominantly these are whitespace changes.
Additionally, the build for Python 3.7 on TravisCI has been tweaked to fail if there are any flake8 errors using the following commandline:
* flake8 . --count --ignore=E252 --max-complexity=31 --max-line-length=127 --show-source --statistics
NOTE: In the future the max cyclomatic complexity should be lowered, but some improvements need to be made first.
One flake8 error is being ignored entirely:
* E252 missing whitespace around parameter equals
* ignored because it doesn't correctly deal with default argument values after a type hint
A few flake8 errors are being selectively ignored in certain files:
* C901 fuction is too complex
* ignored in argparse_completer.py because the complex code is an override of argparse complexity
* E302 expected 2 blank lines after ...
* ignored in all unit test files for convenience
* F401 module imported but unused
* ignored in cmd2/__init__.py because imports are for convenience of cmd2 developers and backwards compatibility
* F821 undefined name
* ignored in cmd2 script files which are intended to run only within cmd2 applications via pyscript where "app" and "cmd" are defined
|
|
|
|
|
|
|
| |
expected output
Also:
- Added unit test for this specific case
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now there is a single class, StdSim in utils.py, which is intended to simulate stdout and stderr file objects.
This class replaced the following:
- pyscript_bridge.py::CopyStream
- transcript.py::OutputTrap
- conftest.py::StdOut
|
|/ |
|
|
|
|
|
|
|
|
| |
Fixed crashes that occur when attempting to open a file in a non-existent directory or a when the filename is too long.
Specifically fixed this when redirecting output to a file and when saving a transcript based on the history.
Also added a couple unit tests related to the fixes.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Added some shared definitions to cmd2/__init__.py -> maybe there's a better place for these?
Figured out how to trick bash into showing argument hints. It's a bit weird.
Updated all of the tests and examples to import cmd2 resources from their new location without the automatic imports in cmd2/__init__.py
For #369
|
| | |
|
|/ |
|
|
|
|
|
| |
Removed things which were only needed for unit tests from __init__.py
- Converted to importing from cmd2.cmd2.<foo> within the relevant unit tests
|
| |
|
| |
|
|
|
|
| |
This reverts commit 4a3d01b679c5db7f6cb670ca981a953eb3b98dc5.
|
|
|
|
| |
Still have a fair amount of work to do to get this sorted.
|
| |
|
|
|
|
|
|
|
| |
Removed all dependency on six other than for six.moves.input
Also:
- Started removing code branches which were for Python 2 support
|
|
|
|
|
| |
mock was a backport of Python's built in unittest.mock and was required for Python 3.2 or earlier
- Since we now support Python 3.4+ moving forward we no longer need to make use of the 3rd party mock module
|