@@ -415,7 +415,7 @@ def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *,
415415 # Keeps track of typed command history in the Python shell
416416 self ._py_history = []
417417
418- # The name by which Python and IPython environments refer to the PyscriptBridge to call app commands
418+ # The name by which Python environments refer to the PyBridge to call app commands
419419 self .py_bridge_name = 'app'
420420
421421 # Defines app-specific variables/functions available in Python shells and pyscripts
@@ -1704,13 +1704,13 @@ def parseline(self, line: str) -> Tuple[str, str, str]:
17041704 statement = self .statement_parser .parse_command_only (line )
17051705 return statement .command , statement .args , statement .command_and_args
17061706
1707- def onecmd_plus_hooks (self , line : str , pyscript_bridge_call : bool = False ) -> bool :
1707+ def onecmd_plus_hooks (self , line : str , py_bridge_call : bool = False ) -> bool :
17081708 """Top-level function called by cmdloop() to handle parsing a line and running the command and all of its hooks.
17091709
17101710 :param line: line of text read from input
1711- :param pyscript_bridge_call : This should only ever be set to True by PyscriptBridge to signify the beginning
1712- of an app() call in a pyscript . It is used to enable/disable the storage of the
1713- command's stdout.
1711+ :param py_bridge_call : This should only ever be set to True by PyBridge to signify the beginning
1712+ of an app() call from Python . It is used to enable/disable the storage of the
1713+ command's stdout.
17141714 :return: True if running of commands should stop
17151715 """
17161716 import datetime
@@ -1750,7 +1750,7 @@ def onecmd_plus_hooks(self, line: str, pyscript_bridge_call: bool = False) -> bo
17501750 try :
17511751 # Get sigint protection while we set up redirection
17521752 with self .sigint_protection :
1753- if pyscript_bridge_call :
1753+ if py_bridge_call :
17541754 # Start saving command's stdout at this point
17551755 self .stdout .pause_storage = False
17561756
@@ -1799,7 +1799,7 @@ def onecmd_plus_hooks(self, line: str, pyscript_bridge_call: bool = False) -> bo
17991799 if not already_redirecting :
18001800 self ._redirecting = False
18011801
1802- if pyscript_bridge_call :
1802+ if py_bridge_call :
18031803 # Stop saving command's stdout before command finalization hooks run
18041804 self .stdout .pause_storage = True
18051805
@@ -3204,13 +3204,13 @@ def _restore_cmd2_env(self, cmd2_env: _SavedCmd2Env) -> None:
32043204 @with_argparser (py_parser , preserve_quotes = True )
32053205 def do_py (self , args : argparse .Namespace ) -> bool :
32063206 """Invoke Python command or shell"""
3207- from .pyscript_bridge import PyscriptBridge
3207+ from .py_bridge import PyBridge
32083208 if self ._in_py :
32093209 err = "Recursively entering interactive Python consoles is not allowed."
32103210 self .perror (err )
32113211 return False
32123212
3213- bridge = PyscriptBridge (self )
3213+ bridge = PyBridge (self )
32143214
32153215 try :
32163216 self ._in_py = True
@@ -3256,7 +3256,7 @@ def py_quit():
32563256 if args .remainder :
32573257 full_command += ' ' + ' ' .join (args .remainder )
32583258
3259- # Set cmd_echo to True so PyscriptBridge statements like: py app('help')
3259+ # Set cmd_echo to True so PyBridge statements like: py app('help')
32603260 # run at the command line will print their output.
32613261 bridge .cmd_echo = True
32623262
@@ -3339,7 +3339,7 @@ def do_run_pyscript(self, args: argparse.Namespace) -> bool:
33393339 @with_argparser (Cmd2ArgumentParser ())
33403340 def do_ipy (self , _ : argparse .Namespace ) -> None :
33413341 """Enter an interactive IPython shell"""
3342- from .pyscript_bridge import PyscriptBridge
3342+ from .py_bridge import PyBridge
33433343 banner = ('Entering an embedded IPython shell. Type quit or <Ctrl>-d to exit.\n '
33443344 'Run Python code from external files with: run filename.py\n ' )
33453345 exit_msg = 'Leaving IPython, back to {}' .format (sys .argv [0 ])
@@ -3349,8 +3349,8 @@ def load_ipy(cmd2_app: Cmd):
33493349 Embed an IPython shell in an environment that is restricted to only the variables in this function
33503350 :param cmd2_app: the instance of the cmd2 app
33513351 """
3352- # Create a variable pointing to the PyscriptBridge and name it using the value of py_bridge_name
3353- bridge = PyscriptBridge (cmd2_app )
3352+ # Create a variable pointing to a PyBridge and name it using the value of py_bridge_name
3353+ bridge = PyBridge (cmd2_app )
33543354 exec ("{} = bridge" .format (cmd2_app .py_bridge_name ))
33553355
33563356 # Add self variable pointing to cmd2_app, if allowed
0 commit comments