From 652122f3c9907a652a9c3a14581bb2aef90bc996 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sun, 23 Jun 2019 20:49:27 -0400 Subject: Made last_result public and restored the initialization of it in __init__ and associated comment --- examples/python_scripting.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/python_scripting.py') 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__': -- cgit v1.2.1