Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Update layout setup to discard areas where the base plugin doesn't exist #15261

Merged
merged 1 commit into from Apr 12, 2021

Conversation

dalthviz
Copy link
Member

@dalthviz dalthviz commented Apr 12, 2021

Description of Changes

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)
  • Included a screenshot or animation (if affecting the UI, see Licecap)

Following #15177 if a dockable plugin is pruned and it's used to define an area for a layout (for example the Outline Explorer) the related area should not be taken into account when applying the layout. Prevents seeing errors like the following when a plugin is pruned:


Traceback (most recent call last):
  File "C:\Users\Daniel\Documents\Spyder\spyder\spyder\plugins\layout\container.py", line 125, in <lambda>
    triggered=lambda: self.quick_layout_switch('default'),
  File "C:\Users\Daniel\Documents\Spyder\spyder\spyder\plugins\layout\container.py", line 393, in quick_layout_switch
    possible_current_layout = self._plugin.quick_layout_switch(index)
  File "C:\Users\Daniel\Documents\Spyder\spyder\spyder\plugins\layout\plugin.py", line 320, in quick_layout_switch
    self.setup_default_layouts(index, settings)
  File "C:\Users\Daniel\Documents\Spyder\spyder\spyder\plugins\layout\plugin.py", line 273, in setup_default_layouts
    layout.set_main_window_layout(self.main, self.get_dockable_plugins())
  File "C:\Users\Daniel\Documents\Spyder\spyder\spyder\plugins\layout\api.py", line 375, in set_main_window_layout
    plugin = main_window.get_plugin(plugin_id)
  File "C:\Users\Daniel\Documents\Spyder\spyder\spyder\app\mainwindow.py", line 170, in get_plugin
    'Plugin "{}" not found!'.format(plugin_name))
spyder.api.exceptions.SpyderAPIError: Plugin "outline_explorer" not found!


Issue(s) Resolved

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: dalthviz

@dalthviz dalthviz added this to the v5.0.1 milestone Apr 12, 2021
@dalthviz dalthviz self-assigned this Apr 12, 2021
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dalthviz! Looks good to me.

@ccordoba12 ccordoba12 merged commit 8350b45 into spyder-ide:5.x Apr 12, 2021
ccordoba12 added a commit that referenced this pull request Apr 12, 2021
@ccordoba12 ccordoba12 changed the title PR: Update layout setup to discard areas where the base plugin doesn't exists PR: Update layout setup to discard areas where the base plugin doesn't exist Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants