summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-09-24 23:44:52 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-09-24 23:44:52 +0200
commitcac130e7543b30be7fbec6484b29191a9f8b1665 (patch)
treee32911ee97022cec9fb979779d373a0bcf2e3744
parenteb096892a9ab3429ba0dcb9654a356afcd01932d (diff)
downloadpoezio-cac130e7543b30be7fbec6484b29191a9f8b1665.tar.gz
poezio-cac130e7543b30be7fbec6484b29191a9f8b1665.tar.bz2
poezio-cac130e7543b30be7fbec6484b29191a9f8b1665.tar.xz
poezio-cac130e7543b30be7fbec6484b29191a9f8b1665.zip
Autoload plugins
-rw-r--r--data/default_config.cfg3
-rw-r--r--src/core.py6
2 files changed, 9 insertions, 0 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg
index 6ba36419..b061cbf4 100644
--- a/data/default_config.cfg
+++ b/data/default_config.cfg
@@ -129,6 +129,9 @@ log_dir =
# You can specify an other directory to use. It will be created if it doesn't exist
plugins_dir =
+# Space separated list of plugins to load on startup
+plugins_autoload =
+
# the full path to the photo (avatar) you want to use
# it should be less than 16Ko
# The avatar is not set by default, because it slows
diff --git a/src/core.py b/src/core.py
index 55026967..0b8442ff 100644
--- a/src/core.py
+++ b/src/core.py
@@ -174,6 +174,12 @@ class Core(object):
self.xmpp.add_event_handler("chatstate_inactive", self.on_chatstate_inactive)
self.timed_events = set()
+ self.autoload_plugins()
+
+ def autoload_plugins(self):
+ plugins = config.get('plugins_autoload', '')
+ for plugin in plugins.split():
+ self.plugin_manager.load(plugin)
def coucou(self):
self.command_pubsub('pubsub.louiz.org')