mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #4414 (Plugin Loading Bug)
This commit is contained in:
parent
1661dbf0ce
commit
2673542326
@ -31,7 +31,8 @@ class Plugin(object):
|
||||
#: For example: ``['windows', 'osx', 'linux']
|
||||
supported_platforms = []
|
||||
|
||||
#: The name of this plugin
|
||||
#: The name of this plugin. You must set it something other
|
||||
#: than Trivial Plugin for it to work.
|
||||
name = 'Trivial Plugin'
|
||||
|
||||
#: The version of this plugin as a 3-tuple (major, minor, revision)
|
||||
|
@ -66,7 +66,8 @@ def load_plugin(path_to_zip_file):
|
||||
raw = re.sub('\r\n', '\n', raw)
|
||||
exec raw in locals
|
||||
for x in locals.values():
|
||||
if isinstance(x, type) and issubclass(x, Plugin):
|
||||
if isinstance(x, type) and issubclass(x, Plugin) and \
|
||||
x.name != 'Trivial Plugin':
|
||||
if x.minimum_calibre_version > version or \
|
||||
platform not in x.supported_platforms:
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user