summaryrefslogtreecommitdiff
path: root/examples/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Add black for automatic code formatTodd Leonhardt2021-01-311-2/+1
|
* Changed isort to force wrapping of imports to reduce merge conflicts from ↵Eric Lin2021-01-221-1/+4
| | | | minor import changes.
* Added info on semantic versioning and branching strategy to CONTRIBUTING.mdTodd Leonhardt2020-04-241-0/+1
| | | | | | | 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
* Updated python scripting exmaple to illustrate howEric Lin2020-02-241-4/+14
| | | | | stdout/stderr is automatically captured in CommandResult during python scripting. Fixes #898
* Renamed locals_in_py to self_in_pyTodd Leonhardt2020-01-272-2/+2
| | | | This more accurately reflects what it controls
* Made three public attributes of cmd2.Cmd no longer settable at runtime by ↵Todd Leonhardt2020-01-271-1/+1
| | | | | | | | | end users The 3 attributes are: - continuation_prompt - locals_in_py - prompt
* Just adding a comment to one of our text file scripts as an exampleTodd Leonhardt2019-07-191-0/+1
|
* Changed all uses of sub-command to subcommandKevin Van Brunt2019-07-191-6/+6
|
* Made last_result public and restored the initialization of it in __init__ ↵Todd Leonhardt2019-06-231-2/+2
| | | | and associated comment
* Updated documentationKevin Van Brunt2019-06-153-5/+5
|
* Transcript testing now properly handles commands which signal the ↵Todd Leonhardt2019-06-061-0/+1
| | | | | | application to quit Implemented an antediluvian TODO
* Fixed issue where calling exit() or quit() from a pyscript would close the ↵Kevin Van Brunt2019-02-061-2/+2
| | | | whole console
* Added help summary and a separate label for commands and topicsKevin Van Brunt2018-12-211-12/+33
|
* Removed newlinesKevin Van Brunt2018-12-211-3/+1
|
* Refactored script to use app()Kevin Van Brunt2018-12-211-32/+27
|
* Updated documentationKevin Van Brunt2018-12-201-2/+2
|
* Refactored script and made OS independent by removing rm callsKevin Van Brunt2018-12-201-26/+40
|
* Added labels for each command help textKevin Van Brunt2018-12-201-2/+13
|
* Fixing flake8 warningKevin Van Brunt2018-12-201-0/+1
|
* Added new example script that saves help text to a fileKevin Van Brunt2018-12-201-0/+67
|
* Fix flake8 issuesTodd Leonhardt2018-12-063-3/+2
| | | | | | | | | | | | | | | | | | | | | | 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
* Deprecated CmdResult helper class and promoted CommandResultTodd Leonhardt2018-06-231-0/+1
| | | | | | | | | | | | | | 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.
* Fixed conditional.py scriptTodd Leonhardt2018-05-261-3/+3
| | | | | | Also: - Made self.locals_in_py = True for main.py and examples/python_scripting.py - This makes debugging easier in the embedded IPython shell provided by the opt-in ipy command
* Simplified implementation of do__relative_loadTodd Leonhardt2017-06-281-0/+3
| | | | Also removed default argument for _relative_load and load
* Moved example scripts from examples to examples/scripts directlyTodd Leonhardt2017-06-214-0/+56
Cleaned up the examples directory by adding a scripts subdirectory. This makes it a bit clearer which Python files are example cmd2 applications and which are example Python scripts for use with the pyscript command.