summaryrefslogtreecommitdiff
path: root/src/plugin_manager.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-03-06 22:57:41 +0100
committermathieui <mathieui@mathieui.net>2013-03-06 22:57:41 +0100
commit370cc874c2dffd6b4fd306213654c355a5ecadf6 (patch)
treee61bfddcc547c5b14fe0a311a15631da1a77f2b4 /src/plugin_manager.py
parentcbf563583cfa429397eabf81f009dfe78dd74398 (diff)
downloadpoezio-370cc874c2dffd6b4fd306213654c355a5ecadf6.tar.gz
poezio-370cc874c2dffd6b4fd306213654c355a5ecadf6.tar.bz2
poezio-370cc874c2dffd6b4fd306213654c355a5ecadf6.tar.xz
poezio-370cc874c2dffd6b4fd306213654c355a5ecadf6.zip
Introduce a new way for plugins to interact with poezio
- 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)
Diffstat (limited to 'src/plugin_manager.py')
-rw-r--r--src/plugin_manager.py5
1 files changed, 4 insertions, 1 deletions
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')