Quote:
Originally Posted by JSWolf
Kovid, can you make the next version of Calibre 2.x refuse to install/try to run a plugin if it doesn't have code for Qt5? This way it would stop people from trying to run a plugin that simply will never work with Calibre 2.x. A good example of this is trying to run the iOS Reader Application plugin that's not Qt5 compatible. Thanks.
|
It can't "refuse to run" it, without first trying to run it. At which point, it barks.
As far as installing, all it can do is look for an attempt to import PyQt5 modules: which is still no guarantee that the plugin is going to function. Then you have plugins that don't use GUI widgets at all, so you don't want to exclude them by requiring a PyQt5 module import. You also can't deny installation to plugins that try to import PyQt4 since plugins that strive for backward compatibility need to try and import those.
So you'd be left looking for plugins that try to import BOTH PyQt4 AND PyQt5, which would once again foil plugins that don't use GUI widgets (and still not guarantee the plugin will function correctly).
Even checking to see whether a plugin was a GUI Interface plugin wouldn't really help since even onImport plugins can have custom gui configs. Anything trying to automatically determine whether to block/allow the installation of a plugin would need to heuristically parse almost all of a plugin's code in some way.
I think it's just best for the user to check on a plugin's compatibility themselves rather than enter that particular rat's nest.