| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| | |
|
| | |
|
| |
|
|
| |
onecmd_plus_hooks
|
| |
|
|
| |
onecmd_plus_hooks
|
| | |
|
| | |
|
| |
|
|
| |
negative number
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
CommandResult.
Either self.data is used or if that's not possible, then self.stderr is used.
This provided applications the ability to print to stderr even if an error didn't occur.
|
| | |
| |
| |
| | |
argparse
|
| |/
|
|
|
|
|
|
| |
ArgparseFunctor
Should correctly force all subsequent arguments to go to the REMAINDER argument once it is detected.
Re-arranged the command generation in ArgparseFunctor to print flag arguments before positionals
Also forces the remainder arguments to always be last.
|
| | |
|
| |
|
|
| |
the CLI
|
| | |
|
| |
|
|
| |
will show output
|
| | |
|
| |
|
|
| |
Documented py command's parsing limitations
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
These classes are subtly different, particularly in terms of their truthiness.
CmdResult
- attributes: out, err, war
- truthy: if err is falsy
CommandResult
- attributes: stdout, stderr, data
- truthy: if err is falsy AND data is not None
So CmdResult was oriented to provide essentially info, error, and warning messages to the user (typically as stirngs), whereas CommandResult is geared towards providing info and error messages to the user as strings in addition to data to the user in a command-specific format which is arbitrary other than it should never be None if the command succeeds.
|
| | |
|
| |
|
|
|
| |
Also:
- Refactored perror() to remove a rarely used optional argument which was unecessary
|
| |
|
|
|
|
|
| |
because they were failing for me.
Added detection of ==SUPPRESS== in subcommand group names to avoid printing it in the help hint.
Added some examples to tab_autocompletion to demonstrate how to tie in to cmd2 path_complete
|
| | |
|
| |
|
|
|
|
|
| |
command from pyscript.
Added support for tab completing application commands in ipython shell
Updated unit tests scripts to set cmd_echo to True to validate command output.
|
| |
|
|
| |
Added pyscript bridge to ipy command. Saving progress.
|
| |
|
|
|
|
|
| |
Removed all legacy pystate objects.
Changed default behavior to clear _last_result before each command
Added utility for creating named tuples with default values
Added tests to exercise new changes.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
https://bugs.python.org/issue15112
Added additional tests - now at 100% coverage of pyscript_bridge.py
Still need handling of special action types: StoreTrue/False, store_const, count
|
| | |
|
| |
|
|
|
|
| |
argparse command positional and flag arguments.
Added initial set of tests
|
| | |
|
|
|
Doesn't handle all argparse argument options yet (nargs, append, flag, probably more)
For #368
|