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 /cmd2/pyscript_bridge.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 'cmd2/pyscript_bridge.py')
-rw-r--r-- | cmd2/pyscript_bridge.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2/pyscript_bridge.py b/cmd2/pyscript_bridge.py index 01d283ea..ac3dfd40 100644 --- a/cmd2/pyscript_bridge.py +++ b/cmd2/pyscript_bridge.py @@ -23,7 +23,7 @@ class CommandResult(namedtuple_with_defaults('CommandResult', ['stdout', 'stderr Any combination of these fields can be used when developing a scripting API for a given command. By default stdout, stderr, and stop will be captured for you. If there is additional command specific data, - then write that to cmd2's _last_result member. That becomes the data member of this tuple. + then write that to cmd2's last_result member. That becomes the data member of this tuple. In some cases, the data member may contain everything needed for a command and storing stdout and stderr might just be a duplication of data that wastes memory. In that case, the StdSim can @@ -88,7 +88,7 @@ class PyscriptBridge(object): # This will be used to capture sys.stderr copy_stderr = StdSim(sys.stderr, echo) - self._cmd2_app._last_result = None + self._cmd2_app.last_result = None stop = False try: @@ -105,5 +105,5 @@ class PyscriptBridge(object): result = CommandResult(stdout=copy_cmd_stdout.getvalue(), stderr=copy_stderr.getvalue() if copy_stderr.getvalue() else None, stop=stop, - data=self._cmd2_app._last_result) + data=self._cmd2_app.last_result) return result |