@@ -181,28 +181,23 @@ def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *,
181181 super ().__init__ (completekey = completekey , stdin = stdin , stdout = stdout )
182182
183183 # Attributes which should NOT be dynamically settable via the set command at runtime
184- # To prevent a user from altering these with the py/ipy commands, remove locals_in_py from the
185- # settable dictionary during your applications's __init__ method.
186184 self .default_to_shell = False # Attempt to run unrecognized commands as shell commands
187185 self .quit_on_sigint = False # Quit the loop on interrupt instead of just resetting prompt
188186 self .allow_redirection = allow_redirection # Security setting to prevent redirection of stdout
189187
190188 # Attributes which ARE dynamically settable via the set command at runtime
191- self .continuation_prompt = '> '
192189 self .debug = False
193190 self .echo = False
194191 self .editor = Cmd .DEFAULT_EDITOR
195192 self .feedback_to_output = False # Do not include nonessentials in >, | output by default (things like timing)
196- self .locals_in_py = False
193+ self .quiet = False # Do not suppress nonessential output
194+ self .timing = False # Prints elapsed time for each command
197195
198196 # The maximum number of CompletionItems to display during tab completion. If the number of completion
199197 # suggestions exceeds this number, they will be displayed in the typical columnized format and will
200198 # not include the description value of the CompletionItems.
201199 self .max_completion_items = 50
202200
203- self .quiet = False # Do not suppress nonessential output
204- self .timing = False # Prints elapsed time for each command
205-
206201 # To make an attribute settable with the "do_set" command, add it to this ...
207202 self .settable = \
208203 {
@@ -211,18 +206,21 @@ def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *,
211206 '(valid values: {}, {}, {})' .format (ansi .STYLE_TERMINAL ,
212207 ansi .STYLE_ALWAYS ,
213208 ansi .STYLE_NEVER )),
214- 'continuation_prompt' : 'On 2nd+ line of input' ,
215209 'debug' : 'Show full error stack on error' ,
216210 'echo' : 'Echo command issued into output' ,
217211 'editor' : 'Program used by ``edit``' ,
218212 'feedback_to_output' : 'Include nonessentials in `|`, `>` results' ,
219- 'locals_in_py' : 'Allow access to your application in py via self' ,
220213 'max_completion_items' : 'Maximum number of CompletionItems to display during tab completion' ,
221- 'prompt' : 'The prompt issued to solicit input' ,
222214 'quiet' : "Don't print nonessential feedback" ,
223215 'timing' : 'Report execution times'
224216 }
225217
218+ # Use as prompt for multiline commands on the 2nd+ line of input
219+ self .continuation_prompt = '> '
220+
221+ # Allow access to your application in embedded Python shells and scripts py via self
222+ self .self_in_py = False
223+
226224 # Commands to exclude from the help menu and tab completion
227225 self .hidden_commands = ['eof' , '_relative_load' , '_relative_run_script' ]
228226
@@ -3118,7 +3116,7 @@ def py_quit():
31183116 self .py_locals ['quit' ] = py_quit
31193117 self .py_locals ['exit' ] = py_quit
31203118
3121- if self .locals_in_py :
3119+ if self .self_in_py :
31223120 self .py_locals ['self' ] = self
31233121 elif 'self' in self .py_locals :
31243122 del self .py_locals ['self' ]
@@ -3238,7 +3236,7 @@ def load_ipy(cmd2_app: Cmd, py_bridge: PyBridge):
32383236 exec ("{} = py_bridge" .format (cmd2_app .py_bridge_name ))
32393237
32403238 # Add self variable pointing to cmd2_app, if allowed
3241- if cmd2_app .locals_in_py :
3239+ if cmd2_app .self_in_py :
32423240 exec ("self = cmd2_app" )
32433241
32443242 # Delete these names from the environment so IPython can't use them
0 commit comments