diff options
author | mathieui <mathieui@mathieui.net> | 2019-12-27 18:49:26 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2019-12-27 18:49:26 +0100 |
commit | d7d4e30eecb0c2ae495be96c42b02109ed7f9ba2 (patch) | |
tree | 3f298e6c0fc052fb7b824191c684964db7599bca /poezio/plugin.py | |
parent | 12a9528d6282303e5e130301a1beca621cfa2e2d (diff) | |
parent | 6a7f5326da004d7a0d78fe5a6d91f9630d832f51 (diff) | |
download | poezio-d7d4e30eecb0c2ae495be96c42b02109ed7f9ba2.tar.gz poezio-d7d4e30eecb0c2ae495be96c42b02109ed7f9ba2.tar.bz2 poezio-d7d4e30eecb0c2ae495be96c42b02109ed7f9ba2.tar.xz poezio-d7d4e30eecb0c2ae495be96c42b02109ed7f9ba2.zip |
Merge branch 'fix-plugin-names' into 'master'
Plugins: use import_module for module in poezio_plugins
See merge request poezio/poezio!52
Diffstat (limited to 'poezio/plugin.py')
-rw-r--r-- | poezio/plugin.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/poezio/plugin.py b/poezio/plugin.py index 1995d7cd..c3d10b38 100644 --- a/poezio/plugin.py +++ b/poezio/plugin.py @@ -395,17 +395,18 @@ class BasePlugin(object, metaclass=SafetyMetaclass): default_config = None - def __init__(self, plugin_api, core, plugins_conf_dir): + def __init__(self, name, plugin_api, core, plugins_conf_dir): + self.__name = name self.core = core # More hack; luckily we'll never have more than one core object SafetyMetaclass.core = core - conf = plugins_conf_dir / (self.__module__ + '.cfg') + conf = plugins_conf_dir / (self.__name + '.cfg') try: self.config = PluginConfig( - conf, self.__module__, default=self.default_config) + conf, self.__name, default=self.default_config) except Exception: log.debug('Error while creating the plugin config', exc_info=True) - self.config = PluginConfig(conf, self.__module__) + self.config = PluginConfig(conf, self.__name) self._api = plugin_api[self.name] self.init() @@ -414,7 +415,7 @@ class BasePlugin(object, metaclass=SafetyMetaclass): """ Get the name (module name) of the plugin. """ - return self.__module__ + return self.__name @property def api(self): |