Skip to content
Snippets Groups Projects
Commit 790850a6 authored by Philipp S. Sommer's avatar Philipp S. Sommer
Browse files

Merge branch 'fix-console' into 'develop'

fix updating current projects in console

See merge request !35
parents 639b503d 97eb0c3d
No related branches found
No related tags found
2 merge requests!39[release] compatibility and bug fixes, cli improvements and code formatting,!35fix updating current projects in console
Pipeline #342716 passed
......@@ -244,13 +244,21 @@ class ConsoleWidget(QtInProcessRichJupyterWidget, DockMixin):
"""Update the `mp` variable in the shell is
``rcParams['console.auto_set_mp']`` with a main project"""
if self.rc["auto_set_mp"] and project is not None and project.is_main:
self.run_command_in_shell("mp = psy.gcp(True)")
try:
self.run_command_in_shell("mp = psy.gcp(True)")
except RuntimeError:
# probably running a script that via IPythons `run` magick
pass
def update_sp(self, project):
"""Update the `sp` variable in the shell is
``rcParams['console.auto_set_sp']`` with a sub project"""
if self.rc["auto_set_sp"] and (project is None or not project.is_main):
self.run_command_in_shell("sp = psy.gcp()")
try:
self.run_command_in_shell("sp = psy.gcp()")
except RuntimeError:
# probably running a script that via IPythons `run` magick
pass
def show_current_help(self, to_end=False, force=False):
"""Show the help of the object at the cursor position if
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment