diff options
author | mathieui <mathieui@mathieui.net> | 2011-09-25 02:39:00 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2011-09-25 02:39:00 +0200 |
commit | 1a6d903e34d505005836f6b8aee3552073a2397e (patch) | |
tree | 63b64fd3ff4f9818512aba47c71afa833b2b9980 /src/plugin_manager.py | |
parent | cac130e7543b30be7fbec6484b29191a9f8b1665 (diff) | |
download | poezio-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.py | 12 |
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: |