summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorEric Lin <anselor@gmail.com>2018-05-02 13:50:27 -0400
committerEric Lin <anselor@gmail.com>2018-05-02 13:50:27 -0400
commitd2d3c2f37d5324b5bc967fe268a92f9d563a3a30 (patch)
treeebbedced651a329a3ab11e963aaf19908aa6f524 /cmd2/cmd2.py
parent97668f9464a6a4cb89e82ccf1c1e8b78146a70fd (diff)
downloadcmd2-git-d2d3c2f37d5324b5bc967fe268a92f9d563a3a30.tar.gz
Updated some documentation.
Diffstat (limited to 'cmd2/cmd2.py')
-rwxr-xr-xcmd2/cmd2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index eb80351b..98adc01f 100755
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -2871,7 +2871,7 @@ Usage: Usage: unalias [-a] name [name ...]
py <command>: Executes a Python command.
py: Enters interactive Python mode.
End with ``Ctrl-D`` (Unix) / ``Ctrl-Z`` (Windows), ``quit()``, '`exit()``.
- Non-python commands can be issued with ``cmd("your command")``.
+ Non-python commands can be issued with ``pyscript_name("your command")``.
Run python code from external script files with ``run("script.py")``
"""
from .pyscript_bridge import PyscriptBridge
@@ -2909,7 +2909,6 @@ Usage: Usage: unalias [-a] name [name ...]
if self.locals_in_py:
self.pystate['self'] = self
- self.pystate['cmd'] = onecmd_plus_hooks
localvars = self.pystate
interp = InteractiveConsole(locals=localvars)
@@ -2932,9 +2931,10 @@ Usage: Usage: unalias [-a] name [name ...]
keepstate = Statekeeper(sys, ('stdin', 'stdout'))
sys.stdout = self.stdout
sys.stdin = self.stdin
+ docstr = self.do_py.__doc__.replace('pyscript_name', self.pyscript_name)
interp.interact(banner="Python %s on %s\n%s\n(%s)\n%s" %
(sys.version, sys.platform, cprt, self.__class__.__name__,
- self.do_py.__doc__))
+ docstr))
except EmbeddedConsoleExit:
pass
if keepstate is not None: