diff options
Diffstat (limited to 'cmd2/pyscript_bridge.py')
-rw-r--r-- | cmd2/pyscript_bridge.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd2/pyscript_bridge.py b/cmd2/pyscript_bridge.py index a4eaf308..47ce29db 100644 --- a/cmd2/pyscript_bridge.py +++ b/cmd2/pyscript_bridge.py @@ -62,11 +62,9 @@ class CommandResult(namedtuple_with_defaults('CommandResult', ['stdout', 'stderr class PyscriptBridge(object): - """Preserves the legacy 'cmd' interface for pyscript while also providing a new python API wrapper for - application commands.""" + """Provides a Python API wrapper for application commands.""" def __init__(self, cmd2_app): self._cmd2_app = cmd2_app - self._last_result = None self.cmd_echo = False def __dir__(self): @@ -92,6 +90,10 @@ class PyscriptBridge(object): # This will be used to capture sys.stderr copy_stderr = StdSim(sys.stderr, echo) + # Pause the storing of any output until onecmd_plus_hooks enables it + copy_cmd_stdout.pause_storage = True + copy_stderr.pause_storage = True + self._cmd2_app._last_result = None try: |