summaryrefslogtreecommitdiff
path: root/examples/scripts/conditional.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Moved example scripts from examples to examples/scripts directlyTodd Leonhardt2017-06-211-0/+39
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.