question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a check_compatibility method to PluginMixin

See original GitHub issue

On 3.x

https://github.com/spyder-ide/spyder/blob/master/spyder/api/plugins.py

Create a new method for class SpyderPluginWidget(PluginWidget):

# For instance Qt4 can be checked here or other things...

    def check_compatibility(self):
        """
        This method can be implemented to check compatibility of plugin on a given os.

        `message` should give information in case of non compatibility:
        For example: 'This plugin does not work with Qt4'
        """
        message = ''
        valid = True
        return valid, message

On top of this we need to change the loading of plugins to load it only if compatible

@ccordoba12, @andfoy, @rlaverde comments, ideas?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
ccordoba12commented, Jun 23, 2017

Sorry, check_compatibility has to be called in the __init__ method of SpyderPluginWidget:

https://github.com/spyder-ide/spyder/blob/3.x/spyder/plugins/__init__.py#L539

That way it will be run every time a plugin is created.

@dalthviz, please add the check_compatibility method to SpyderPluginWidget with @goanpeca suggestion, then call it in its __init__ method.

0reactions
ccordoba12commented, Jun 23, 2017

Yes, that’s the idea, and use check_compatibility instead.

But @goanpeca, then check_compatibility should be the first thing to run in register_plugin, right? That way, if compatibility is not satisfied, the plugin would not continue the registering process, and will show a (non-modal) QMessageBox instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found