summaryrefslogtreecommitdiff
path: root/src/plugin_manager.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-09-25 02:39:00 +0200
committermathieui <mathieui@mathieui.net>2011-09-25 02:39:00 +0200
commit1a6d903e34d505005836f6b8aee3552073a2397e (patch)
tree63b64fd3ff4f9818512aba47c71afa833b2b9980 /src/plugin_manager.py
parentcac130e7543b30be7fbec6484b29191a9f8b1665 (diff)
downloadpoezio-1a6d903e34d505005836f6b8aee3552073a2397e.tar.gz
poezio-1a6d903e34d505005836f6b8aee3552073a2397e.tar.bz2
poezio-1a6d903e34d505005836f6b8aee3552073a2397e.tar.xz
poezio-1a6d903e34d505005836f6b8aee3552073a2397e.zip
Add a config file to the plugins by default
Diffstat (limited to 'src/plugin_manager.py')
-rw-r--r--src/plugin_manager.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugin_manager.py b/src/plugin_manager.py
index 2a7a116f..0ffee7ee 100644
--- a/src/plugin_manager.py
+++ b/src/plugin_manager.py
@@ -9,11 +9,21 @@ plugins_dir = plugins_dir or\
os.path.join(os.environ.get('XDG_DATA_HOME') or\
os.path.join(os.environ.get('HOME'), '.local', 'share'),
'poezio', 'plugins')
+
+plugins_conf_dir = os.path.join(os.environ.get('XDG_CONFIG_HOME'), 'poezio',\
+ 'plugins')
+
try:
os.makedirs(plugins_dir)
except OSError:
pass
+try:
+ os.makedirs(plugins_conf_dir)
+except OSError:
+ pass
+
+
sys.path.append(plugins_dir)
class PluginManager(object):
@@ -49,7 +59,7 @@ class PluginManager(object):
self.modules[name] = module
self.commands[name] = {}
self.event_handlers[name] = []
- self.plugins[name] = module.Plugin(self, self.core)
+ self.plugins[name] = module.Plugin(self, self.core, plugins_conf_dir)
def unload(self, name):
if name in self.plugins: