From 0f78975333688dd808517e77a176f609b0d6ac98 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Thu, 28 Dec 2023 16:20:18 -0500 Subject: [PATCH 1/2] Layout: Fix error when plugins required for tabification are unavailable This was causing a crash at startup in some cases. --- spyder/plugins/layout/plugin.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spyder/plugins/layout/plugin.py b/spyder/plugins/layout/plugin.py index 8e4f99befa3..9f254b217e7 100644 --- a/spyder/plugins/layout/plugin.py +++ b/spyder/plugins/layout/plugin.py @@ -1058,7 +1058,14 @@ def tabify_helper(plugin, next_to_plugins): return False # Get the actual plugins from their names - next_to_plugins = [self.get_plugin(p) for p in next_to_plugins] + next_to_plugins = [ + self.get_plugin(p, error=False) for p in next_to_plugins + ] + + # Remove not available plugins from next_to_plugins + next_to_plugins = [ + p for p in next_to_plugins if p is not None + ] if plugin.get_conf('first_time', True): # This tabifies external and internal plugins that are loaded for From 1f9f1c68bf906d7eb39da4542809706ff0031dec Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Mon, 8 Jul 2024 20:31:30 -0400 Subject: [PATCH 2/2] Layout: Ensure that plugins that are by default next to Help can be next to VariableExplorer too --- spyder/plugins/breakpoints/plugin.py | 2 +- spyder/plugins/onlinehelp/plugin.py | 2 +- spyder/plugins/profiler/plugin.py | 2 +- spyder/plugins/pylint/plugin.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spyder/plugins/breakpoints/plugin.py b/spyder/plugins/breakpoints/plugin.py index 568ede0d165..4c798ddcde5 100644 --- a/spyder/plugins/breakpoints/plugin.py +++ b/spyder/plugins/breakpoints/plugin.py @@ -40,7 +40,7 @@ class Breakpoints(SpyderDockablePlugin): NAME = 'breakpoints' REQUIRES = [Plugins.Editor] OPTIONAL = [Plugins.MainMenu] - TABIFY = [Plugins.Help] + TABIFY = [Plugins.VariableExplorer, Plugins.Help] WIDGET_CLASS = BreakpointWidget CONF_SECTION = NAME CONF_FILE = False diff --git a/spyder/plugins/onlinehelp/plugin.py b/spyder/plugins/onlinehelp/plugin.py index 4f33b21738b..b27fcf4db9c 100644 --- a/spyder/plugins/onlinehelp/plugin.py +++ b/spyder/plugins/onlinehelp/plugin.py @@ -27,7 +27,7 @@ class OnlineHelp(SpyderDockablePlugin): """ NAME = 'onlinehelp' - TABIFY = Plugins.Help + TABIFY = [Plugins.VariableExplorer, Plugins.Help] CONF_SECTION = NAME CONF_FILE = False WIDGET_CLASS = PydocBrowser diff --git a/spyder/plugins/profiler/plugin.py b/spyder/plugins/profiler/plugin.py index a6318ee65d4..90ca246c57b 100644 --- a/spyder/plugins/profiler/plugin.py +++ b/spyder/plugins/profiler/plugin.py @@ -39,7 +39,7 @@ class Profiler(SpyderDockablePlugin): NAME = 'profiler' REQUIRES = [Plugins.Preferences, Plugins.Editor] OPTIONAL = [Plugins.MainMenu] - TABIFY = [Plugins.Help] + TABIFY = [Plugins.VariableExplorer, Plugins.Help] WIDGET_CLASS = ProfilerWidget CONF_SECTION = NAME CONF_WIDGET_CLASS = ProfilerConfigPage diff --git a/spyder/plugins/pylint/plugin.py b/spyder/plugins/pylint/plugin.py index 5e34db46305..d112dae282a 100644 --- a/spyder/plugins/pylint/plugin.py +++ b/spyder/plugins/pylint/plugin.py @@ -35,7 +35,7 @@ class Pylint(SpyderDockablePlugin): CONF_WIDGET_CLASS = PylintConfigPage REQUIRES = [Plugins.Preferences, Plugins.Editor] OPTIONAL = [Plugins.MainMenu, Plugins.Projects] - TABIFY = [Plugins.Help] + TABIFY = [Plugins.VariableExplorer, Plugins.Help] CONF_FILE = False DISABLE_ACTIONS_WHEN_HIDDEN = False