Add a check_compatibility method to PluginMixin
See original GitHub issueOn 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:
- Created 6 years ago
- Reactions:2
- Comments:11 (11 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Sorry,
check_compatibilityhas 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_compatibilitymethod to SpyderPluginWidget with @goanpeca suggestion, then call it in its__init__method.Yes, that’s the idea, and use
check_compatibilityinstead.But @goanpeca, then
check_compatibilityshould be the first thing to run inregister_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.