diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-01-27 22:49:34 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-01-27 22:49:34 -0500 |
commit | 415f1cb1c7dd5fbfe21cca0c6eea2eb998bbd1a0 (patch) | |
tree | f38d9d7496e712ef36c0856bf4c0ddcb17219c18 /cmd2/cmd2.py | |
parent | 0f8f90cc2ade4135193f5399e5e6a12271668867 (diff) | |
download | cmd2-git-415f1cb1c7dd5fbfe21cca0c6eea2eb998bbd1a0.tar.gz |
Renamed locals_in_py to self_in_py
This more accurately reflects what it controls
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 609f01ad..a36bcdb6 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -181,7 +181,7 @@ class Cmd(cmd.Cmd): super().__init__(completekey=completekey, stdin=stdin, stdout=stdout) # Attributes which should NOT be dynamically settable via the set command at runtime - # To prevent a user from altering these with the py/ipy commands, remove locals_in_py from the + # To prevent a user from altering these with the py/ipy commands, remove self_in_py from the # settable dictionary during your applications's __init__ method. self.default_to_shell = False # Attempt to run unrecognized commands as shell commands self.quit_on_sigint = False # Quit the loop on interrupt instead of just resetting prompt @@ -221,7 +221,7 @@ class Cmd(cmd.Cmd): self.continuation_prompt = '> ' # Allow access to your application in embedded Python shells and scripts py via self - self.locals_in_py = False + self.self_in_py = False # Commands to exclude from the help menu and tab completion self.hidden_commands = ['eof', '_relative_load', '_relative_run_script'] @@ -3118,7 +3118,7 @@ class Cmd(cmd.Cmd): self.py_locals['quit'] = py_quit self.py_locals['exit'] = py_quit - if self.locals_in_py: + if self.self_in_py: self.py_locals['self'] = self elif 'self' in self.py_locals: del self.py_locals['self'] @@ -3238,7 +3238,7 @@ class Cmd(cmd.Cmd): exec("{} = py_bridge".format(cmd2_app.py_bridge_name)) # Add self variable pointing to cmd2_app, if allowed - if cmd2_app.locals_in_py: + if cmd2_app.self_in_py: exec("self = cmd2_app") # Delete these names from the environment so IPython can't use them |