summaryrefslogtreecommitdiff
path: root/src/mailman/config/config.py
diff options
context:
space:
mode:
authorJ08nY2017-05-31 02:09:09 +0200
committerJ08nY2017-08-07 17:39:07 +0200
commit38a86adcdb78c1944c26a5ab8deddff619b33bcf (patch)
treec9b6f8810e33657161535bb887829305306ce0f2 /src/mailman/config/config.py
parent324226f1f859f6be5e932dc9abe638aba268d154 (diff)
downloadmailman-38a86adcdb78c1944c26a5ab8deddff619b33bcf.tar.gz
mailman-38a86adcdb78c1944c26a5ab8deddff619b33bcf.tar.zst
mailman-38a86adcdb78c1944c26a5ab8deddff619b33bcf.zip
Add pluggable components.
- Adds the notion of a 'plugin'. - A plugin has a package path and a flag specifying whether it's enabled or not. - Adds a find_pluggable_components function similar to the find_components one. This one dynamically searches not only the mailman package but all of plugins. - e.g. find_pluggable_components('rules', IRule) finds all IRule components in mailman.rules but also in example_plugin.rules for plugin names example_plugin. - Uses the find_pluggable_components function in place of find_components when searching for Rules, Handlers, Chains, EmailCommands, and Styles.
Diffstat (limited to '')
-rw-r--r--src/mailman/config/config.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mailman/config/config.py b/src/mailman/config/config.py
index 61c9fe6ed..2ba657905 100644
--- a/src/mailman/config/config.py
+++ b/src/mailman/config/config.py
@@ -158,7 +158,7 @@ class Configuration:
else category.template_dir),
)
# Directories.
- for name in ('archive', 'bin', 'cache', 'data', 'etc', 'ext',
+ for name in ('archive', 'bin', 'cache', 'data', 'etc',
'list_data', 'lock', 'log', 'messages', 'queue'):
key = '{}_dir'.format(name)
substitutions[key] = getattr(category, key)
@@ -248,6 +248,11 @@ class Configuration:
yield archiver
@property
+ def plugin_configs(self):
+ """Iterate over all the plugin configuration sections."""
+ return self._config.getByCategory('plugin', [])
+
+ @property
def language_configs(self):
"""Iterate over all the language configuration sections."""
yield from self._config.getByCategory('language', [])