summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CODEOWNERS2
-rwxr-xr-xREADME.md6
-rw-r--r--cmd2/pyscript_bridge.py2
-rw-r--r--docs/freefeatures.rst31
-rw-r--r--docs/integrating.rst4
-rw-r--r--docs/settingchanges.rst4
-rw-r--r--docs/transcript.rst4
7 files changed, 21 insertions, 32 deletions
diff --git a/CODEOWNERS b/CODEOWNERS
index 0192ef0f..6018eb86 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -35,7 +35,7 @@ examples/tab_au*.py @anselor
examples/tab_co*.py @kmvanbrunt
# Unit Tests
-tests/pyscript/* @anselor
+tests/pyscript/* @anselor @kmvanbrunt
tests/transcripts/* @kotfu
tests/__init__.py @kotfu
tests/conftest.py @kotfu @tleonhardt
diff --git a/README.md b/README.md
index 562f539f..76ab515c 100755
--- a/README.md
+++ b/README.md
@@ -20,8 +20,8 @@ Click on image below to watch a short video demonstrating the capabilities of cm
Main Features
-------------
- Searchable command history (`history` command and `<Ctrl>+r`) - optionally persistent
-- Text file scripting of your application with `load` (`@`) and `_relative_load` (`@@`)
-- Python scripting of your application with ``pyscript``
+- Text file scripting of your application with `run_script` (`@`) and `_relative_run_script` (`@@`)
+- Python scripting of your application with ``run_pyscript``
- Run shell commands with ``!``
- Pipe command output to shell commands with `|`
- Redirect command output to file with `>`, `>>`
@@ -111,7 +111,7 @@ Instructions for implementing each feature follow.
- See [script.txt](https://github.com/python-cmd2/cmd2/blob/master/examples/scripts/script.txt) for a trivial example script that can be
used in any `cmd2` application with the `load` command (or `@` shortcut)
-- Powerful and flexible built-in Python scripting of your application using the `pyscript` command
+- Powerful and flexible built-in Python scripting of your application using the `run_pyscript` command
- Run arbitrary Python scripts within your `cmd2` application with the ability to also call custom `cmd2` commands
- No separate API for your end users to learn
- Syntax for calling `cmd2` commands in a `pyscript` is essentially identical to what they would enter on the command line
diff --git a/cmd2/pyscript_bridge.py b/cmd2/pyscript_bridge.py
index 31c1ab9c..01d283ea 100644
--- a/cmd2/pyscript_bridge.py
+++ b/cmd2/pyscript_bridge.py
@@ -1,6 +1,6 @@
# coding=utf-8
"""
-Bridges calls made inside of pyscript with the Cmd2 host app while maintaining a reasonable
+Bridges calls made inside of a pyscript with the Cmd2 host app while maintaining a reasonable
degree of isolation between the two
"""
diff --git a/docs/freefeatures.rst b/docs/freefeatures.rst
index 12421601..a06bab90 100644
--- a/docs/freefeatures.rst
+++ b/docs/freefeatures.rst
@@ -13,24 +13,15 @@ Script files
============
Text files can serve as scripts for your ``cmd2``-based
-application, with the ``load``, ``_relative_load``, and ``edit`` commands.
+application, with the ``run_script``, ``_relative_run_script``, and ``edit`` commands.
Both ASCII and UTF-8 encoded unicode text files are supported.
Simply include one command per line, typed exactly as you would inside a ``cmd2`` application.
-The ``load`` command loads commands from a script file into a queue and then the normal cmd2 REPL
-resumes control and executes the commands in the queue in FIFO order. A side effect of this
-is that if you redirect/pipe the output of a load command, it will redirect the output of the ``load``
-command itself, but will NOT redirect the output of the command loaded from the script file. Of course,
-you can add redirection to the commands being run in the script file, e.g.::
+.. automethod:: cmd2.cmd2.Cmd.do_run_script
- # This is your script file
- command arg1 arg2 > file.txt
-
-.. automethod:: cmd2.cmd2.Cmd.do_load
-
-.. automethod:: cmd2.cmd2.Cmd.do__relative_load
+.. automethod:: cmd2.cmd2.Cmd.do__relative_run_script
.. automethod:: cmd2.cmd2.Cmd.do_edit
@@ -51,7 +42,7 @@ Comments can be useful in :ref:`scripts`, but would be pointless within an inter
Startup Initialization Script
=============================
-You can load and execute commands from a startup initialization script by passing a file path to the ``startup_script``
+You can execute commands from a startup initialization script by passing a file path to the ``startup_script``
argument to the ``cmd2.Cmd.__init__()`` method like so::
class StartupApp(cmd2.Cmd):
@@ -188,16 +179,16 @@ conditional control flow logic. See the **python_scripting.py** ``cmd2`` applic
the **script_conditional.py** script in the ``examples`` source code directory for an
example of how to achieve this in your own applications.
-Using ``py`` to run scripts directly is considered deprecated. The newer ``pyscript`` command
+Using ``py`` to run scripts directly is considered deprecated. The newer ``run_pyscript`` command
is superior for doing this in two primary ways:
- it supports tab-completion of file system paths
- it has the ability to pass command-line arguments to the scripts invoked
-There are no disadvantages to using ``pyscript`` as opposed to ``py run()``. A simple example
-of using ``pyscript`` is shown below along with the arg_printer_ script::
+There are no disadvantages to using ``run_pyscript`` as opposed to ``py run()``. A simple example
+of using ``run_pyscript`` is shown below along with the arg_printer_ script::
- (Cmd) pyscript examples/scripts/arg_printer.py foo bar baz
+ (Cmd) run_pyscript examples/scripts/arg_printer.py foo bar baz
Running Python script 'arg_printer.py' which was called with 3 arguments
arg 1: 'foo'
arg 2: 'bar'
@@ -390,7 +381,7 @@ would::
If you want to save the commands to a text file, but not edit and re-run them,
use the ``-o`` or ``--output-file`` option. This is a great way to create
-:ref:`scripts`, which can be loaded and executed using the ``load`` command. To
+:ref:`scripts`, which can be executed using the ``run_script`` command. To
save the first 5 commands entered in this session to a text file::
(Cmd) history :5 -o history.txt
@@ -512,8 +503,8 @@ Tab-Completion
``cmd2`` adds tab-completion of file system paths for all built-in commands where it makes sense, including:
- ``edit``
-- ``load``
-- ``pyscript``
+- ``run_pyscript``
+- ``run_script``
- ``shell``
``cmd2`` also adds tab-completion of shell commands to the ``shell`` command.
diff --git a/docs/integrating.rst b/docs/integrating.rst
index a8377fdb..aeb8ceca 100644
--- a/docs/integrating.rst
+++ b/docs/integrating.rst
@@ -128,9 +128,7 @@ the main loop for the program by using code like the following::
app.postloop()
The **runcmds_plus_hooks()** method is a convenience method to run multiple
-commands via **onecmd_plus_hooks()**. It properly deals with ``load`` commands
-which under the hood put commands in a FIFO queue as it reads them in from a
-script file.
+commands via **onecmd_plus_hooks()**.
The **onecmd_plus_hooks()** method will do the following to execute a single
``cmd2`` command in a normal fashion:
diff --git a/docs/settingchanges.rst b/docs/settingchanges.rst
index b9ad4a22..aa6d9084 100644
--- a/docs/settingchanges.rst
+++ b/docs/settingchanges.rst
@@ -23,10 +23,10 @@ following shortcuts are defined:
shell: run as OS-level command
``@``
- load script file
+ run script file
``@@``
- load script file; filename is relative to current script location
+ run script file; filename is relative to current script location
To define more shortcuts, update the dict ``App.shortcuts`` with the
{'shortcut': 'command_name'} (omit ``do_``)::
diff --git a/docs/transcript.rst b/docs/transcript.rst
index c7c31fd6..089ab704 100644
--- a/docs/transcript.rst
+++ b/docs/transcript.rst
@@ -34,9 +34,9 @@ This is by far the easiest way to generate a transcript.
Automatically from a script file
--------------------------------
-A transcript can also be automatically generated from a script file using ``load -t``::
+A transcript can also be automatically generated from a script file using ``run_script -t``::
- (Cmd) load scripts/script.txt -t transcript.txt
+ (Cmd) run_script scripts/script.txt -t transcript.txt
2 commands and their outputs saved to transcript file 'transcript.txt'
(Cmd)