From 2673542326d28b9f8b21c0215e712b41ce5b906d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Jan 2010 01:31:37 -0700 Subject: [PATCH] Fix #4414 (Plugin Loading Bug) --- src/calibre/customize/__init__.py | 3 ++- src/calibre/customize/ui.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/customize/__init__.py b/src/calibre/customize/__init__.py index 82a02cf196..736ee2a940 100644 --- a/src/calibre/customize/__init__.py +++ b/src/calibre/customize/__init__.py @@ -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) diff --git a/src/calibre/customize/ui.py b/src/calibre/customize/ui.py index 3a79069ec6..9627ac4853 100644 --- a/src/calibre/customize/ui.py +++ b/src/calibre/customize/ui.py @@ -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