summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/basic.py2
-rwxr-xr-xexamples/cmd_as_argument.py2
-rwxr-xr-xexamples/hello_cmd2.py2
-rwxr-xr-xexamples/initialization.py2
-rwxr-xr-xexamples/override_parser.py2
-rwxr-xr-xexamples/python_scripting.py2
-rw-r--r--examples/scripts/conditional.py2
-rw-r--r--examples/scripts/save_help_text.py2
8 files changed, 8 insertions, 8 deletions
diff --git a/examples/basic.py b/examples/basic.py
index 75672a6b..37db6501 100755
--- a/examples/basic.py
+++ b/examples/basic.py
@@ -22,7 +22,7 @@ class BasicApp(cmd2.Cmd):
self.intro = style('Welcome to PyOhio 2019 and cmd2!', fg='red', bg='white', bold=True) + ' 😀'
# Allow access to your application in py and ipy via self
- self.locals_in_py = True
+ self.self_in_py = True
# Set the default category name
self.default_category = 'cmd2 Built-in Commands'
diff --git a/examples/cmd_as_argument.py b/examples/cmd_as_argument.py
index 49a50670..08643a50 100755
--- a/examples/cmd_as_argument.py
+++ b/examples/cmd_as_argument.py
@@ -33,7 +33,7 @@ class CmdLineApp(cmd2.Cmd):
# Set use_ipython to True to enable the "ipy" command which embeds and interactive IPython shell
super().__init__(allow_cli_args=False, use_ipython=True, multiline_commands=['orate'], shortcuts=shortcuts)
- self.locals_in_py = True
+ self.self_in_py = True
self.maxrepeats = 3
# Make maxrepeats settable at runtime
self.settable['maxrepeats'] = 'max repetitions for speak command'
diff --git a/examples/hello_cmd2.py b/examples/hello_cmd2.py
index 84754623..94ec334f 100755
--- a/examples/hello_cmd2.py
+++ b/examples/hello_cmd2.py
@@ -12,6 +12,6 @@ if __name__ == '__main__':
# Set "use_ipython" to True to include the ipy command if IPython is installed, which supports advanced interactive
# debugging of your application via introspection on self.
app = cmd2.Cmd(use_ipython=True, persistent_history_file='cmd2_history.dat')
- app.locals_in_py = True # Enable access to "self" within the py command
+ app.self_in_py = True # Enable access to "self" within the py command
app.debug = True # Show traceback if/when an exception occurs
sys.exit(app.cmdloop())
diff --git a/examples/initialization.py b/examples/initialization.py
index e26aac9f..32aa852f 100755
--- a/examples/initialization.py
+++ b/examples/initialization.py
@@ -33,7 +33,7 @@ class BasicApp(cmd2.Cmd):
self.continuation_prompt = '... '
# Allow access to your application in py and ipy via self
- self.locals_in_py = True
+ self.self_in_py = True
# Set the default category name
self.default_category = 'cmd2 Built-in Commands'
diff --git a/examples/override_parser.py b/examples/override_parser.py
index ddfa8323..eecb0e88 100755
--- a/examples/override_parser.py
+++ b/examples/override_parser.py
@@ -19,6 +19,6 @@ from cmd2 import cmd2
if __name__ == '__main__':
import sys
app = cmd2.Cmd(use_ipython=True, persistent_history_file='cmd2_history.dat')
- app.locals_in_py = True # Enable access to "self" within the py command
+ app.self_in_py = True # Enable access to "self" within the py command
app.debug = True # Show traceback if/when an exception occurs
sys.exit(app.cmdloop())
diff --git a/examples/python_scripting.py b/examples/python_scripting.py
index 8c680d33..fc23c562 100755
--- a/examples/python_scripting.py
+++ b/examples/python_scripting.py
@@ -29,7 +29,7 @@ class CmdLineApp(cmd2.Cmd):
super().__init__(use_ipython=True)
self._set_prompt()
self.intro = 'Happy 𝛑 Day. Note the full Unicode support: 😇 💩'
- self.locals_in_py = True
+ self.self_in_py = True
def _set_prompt(self):
"""Set prompt so it displays the current working directory."""
diff --git a/examples/scripts/conditional.py b/examples/scripts/conditional.py
index 2e307cb4..eb4c203e 100644
--- a/examples/scripts/conditional.py
+++ b/examples/scripts/conditional.py
@@ -8,7 +8,7 @@ To run it you should do the following:
run_pyscript scripts/conditional.py directory_path
Note: The "app" function is defined within the cmd2 embedded Python environment and in there "self" is your cmd2
-application instance. Note: self only exists in this environment if locals_in_py is True.
+application instance. Note: self only exists in this environment if self_in_py is True.
"""
import os
import sys
diff --git a/examples/scripts/save_help_text.py b/examples/scripts/save_help_text.py
index 2d1c2c41..cc4cfcc7 100644
--- a/examples/scripts/save_help_text.py
+++ b/examples/scripts/save_help_text.py
@@ -60,7 +60,7 @@ def main() -> None:
# Make sure we have access to self
if 'self' not in globals():
- print("Re-run this script from a cmd2 application where locals_in_py is True")
+ print("Re-run this script from a cmd2 application where self_in_py is True")
return
# Make sure the user passed in an output file