diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-23 21:11:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-23 21:11:01 -0400 |
commit | bef07746e33da9def33d814913891384a545a95c (patch) | |
tree | 86b162f79663f70cbe88e64deb4cecb93106ba68 /examples/python_scripting.py | |
parent | c12ba0ff11b3a8fd083c641cb9149aff6494bbf9 (diff) | |
parent | eb1936e568a2ca4817ab0cd640220a5bc355e226 (diff) | |
download | cmd2-git-bef07746e33da9def33d814913891384a545a95c.tar.gz |
Merge pull request #703 from python-cmd2/public_api
Minimize public API of cmd2.Cmd class
Diffstat (limited to 'examples/python_scripting.py')
-rwxr-xr-x | examples/python_scripting.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/python_scripting.py b/examples/python_scripting.py index 3e8f64ef..c45648bc 100755 --- a/examples/python_scripting.py +++ b/examples/python_scripting.py @@ -58,7 +58,7 @@ class CmdLineApp(cmd2.Cmd): if not arglist or len(arglist) != 1: self.perror("cd requires exactly 1 argument:", traceback_war=False) self.do_help('cd') - self._last_result = cmd2.CommandResult('', 'Bad arguments') + self.last_result = cmd2.CommandResult('', 'Bad arguments') return # Convert relative paths to absolute paths @@ -84,7 +84,7 @@ class CmdLineApp(cmd2.Cmd): if err: self.perror(err, traceback_war=False) - self._last_result = cmd2.CommandResult(out, err, data) + self.last_result = cmd2.CommandResult(out, err, data) # Enable tab completion for cd command def complete_cd(self, text, line, begidx, endidx): @@ -100,7 +100,7 @@ class CmdLineApp(cmd2.Cmd): if unknown: self.perror("dir does not take any positional arguments:", traceback_war=False) self.do_help('dir') - self._last_result = cmd2.CommandResult('', 'Bad arguments') + self.last_result = cmd2.CommandResult('', 'Bad arguments') return # Get the contents as a list @@ -113,7 +113,7 @@ class CmdLineApp(cmd2.Cmd): self.stdout.write(fmt.format(f)) self.stdout.write('\n') - self._last_result = cmd2.CommandResult(data=contents) + self.last_result = cmd2.CommandResult(data=contents) if __name__ == '__main__': |