From 370cc874c2dffd6b4fd306213654c355a5ecadf6 Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 6 Mar 2013 22:57:41 +0100 Subject: Introduce a new way for plugins to interact with poezio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Try to reduce the use of the “core” object in the plugins - New “api” member for each BasePlugin which is a wrapper around the unique PluginAPI object. (instead of having the methods directly in BasePlugin and then calling the PluginManager) - Documented methods with rst (for sphinx) --- src/plugin_manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugin_manager.py') diff --git a/src/plugin_manager.py b/src/plugin_manager.py index a8c651e9..afd04330 100644 --- a/src/plugin_manager.py +++ b/src/plugin_manager.py @@ -14,6 +14,7 @@ from gettext import gettext as _ import core import tabs +from plugin import PluginAPI from config import config log = logging.getLogger(__name__) @@ -63,6 +64,8 @@ class PluginManager(object): self.tab_commands = {} #module name -> dict of tab types; tab type -> commands loaded by the module self.keys = {} # module name → dict of keys/handlers loaded for the module self.tab_keys = {} #module name → dict of tab types; tab type → list of keybinds (tuples) + self.roster_elements = {} + self.plugin_api = PluginAPI(core, self) def load(self, name, notify=True): """ @@ -96,7 +99,7 @@ class PluginManager(object): self.tab_keys[name] = {} self.tab_commands[name] = {} self.event_handlers[name] = [] - self.plugins[name] = module.Plugin(self, self.core, plugins_conf_dir) + self.plugins[name] = module.Plugin(self.plugin_api, self.core, plugins_conf_dir) if notify: self.core.information('Plugin %s loaded' % name, 'Info') -- cgit v1.2.3