[kupfer] core: Reload enabled plugins properly in import_plugin
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] core: Reload enabled plugins properly in import_plugin
- Date: Thu, 4 Feb 2010 09:57:01 +0000 (UTC)
commit 5d077bca47faf395a76057d8fa0a38be4aba0bd4
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Thu Feb 4 00:40:31 2010 +0100
core: Reload enabled plugins properly in import_plugin
In core.plugins we must overwrite a previous FakePlugin with a true
plugin if we try to import it properly at a later time.
kupfer/core/plugins.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/core/plugins.py b/kupfer/core/plugins.py
index 4ad468a..ab1e69c 100644
--- a/kupfer/core/plugins.py
+++ b/kupfer/core/plugins.py
@@ -261,7 +261,7 @@ def _staged_import(name, import_hook):
def import_plugin(name):
- if name in _imported_plugins:
+ if is_plugin_loaded(name):
return _imported_plugins[name]
plugin = None
try:
@@ -329,7 +329,7 @@ def load_plugin_sources(plugin_name, attr=sources_attribute, instantiate=True):
# Plugin Initialization & Error
def is_plugin_loaded(plugin_name):
return (plugin_name in _imported_plugins and
- not get_plugin_attribute(plugin_name, "is_fake_plugin"))
+ not getattr(_imported_plugins[plugin_name], "is_fake_plugin", None))
def initialize_plugin(plugin_name):
"""Initialize plugin.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]