summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJ08nY2017-06-06 01:05:08 +0200
committerJ08nY2017-06-17 19:35:47 +0200
commit92891f50c997b859deb4fe583e507cf2ce3b4980 (patch)
tree12ee4ea0aad6305b830559dada596346cab00500 /src
parentf20e5d10b1ec0e920eba15f3b22dc3c48ea1ac85 (diff)
downloadmailman-92891f50c997b859deb4fe583e507cf2ce3b4980.tar.gz
mailman-92891f50c997b859deb4fe583e507cf2ce3b4980.tar.zst
mailman-92891f50c997b859deb4fe583e507cf2ce3b4980.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/config/schema.cfg8
-rw-r--r--src/mailman/rest/docs/plugins.rst1
-rw-r--r--src/mailman/rest/plugins.py3
-rw-r--r--src/mailman/rest/tests/test_plugins.py1
4 files changed, 12 insertions, 1 deletions
diff --git a/src/mailman/config/schema.cfg b/src/mailman/config/schema.cfg
index 0e7936943..cae95a07f 100644
--- a/src/mailman/config/schema.cfg
+++ b/src/mailman/config/schema.cfg
@@ -91,6 +91,14 @@ class:
# Whether to enable this plugin or not.
enable: no
+# Additional config for this plugin. The path can be either a file system path
+# or a Python import path. If the value starts with python: then it is
+# a Python import path, otherwise it is a file system path. File system paths
+# must be absolute since no guarantees are made about the current working
+# directory. Python paths should not include the trailing .cfg, which the file
+# must end with.
+configuration:
+
[shell]
# `mailman shell` (also `withlist`) gives you an interactive prompt that you
diff --git a/src/mailman/rest/docs/plugins.rst b/src/mailman/rest/docs/plugins.rst
index 787726e55..737a911c0 100644
--- a/src/mailman/rest/docs/plugins.rst
+++ b/src/mailman/rest/docs/plugins.rst
@@ -8,6 +8,7 @@ Plugins can supply REST routes.
>>> dump_json('http://localhost:9001/3.1/plugins')
entry 0:
class: mailman.testing.plugin.ExamplePlugin
+ configuration:
enable: True
http_etag: "..."
name: example
diff --git a/src/mailman/rest/plugins.py b/src/mailman/rest/plugins.py
index ac8fc0ace..2209e634e 100644
--- a/src/mailman/rest/plugins.py
+++ b/src/mailman/rest/plugins.py
@@ -33,7 +33,8 @@ class AllPlugins(CollectionMixin):
'name': plugin_config.name.split('.')[-1],
'class': plugin_config['class'],
'enable': as_boolean(plugin_config['enable']),
- 'path': plugin_config['path']
+ 'path': plugin_config['path'],
+ 'configuration': plugin_config['configuration']
}
return resource
diff --git a/src/mailman/rest/tests/test_plugins.py b/src/mailman/rest/tests/test_plugins.py
index f6d7afb76..9c12e1160 100644
--- a/src/mailman/rest/tests/test_plugins.py
+++ b/src/mailman/rest/tests/test_plugins.py
@@ -41,6 +41,7 @@ class TestAPI31Plugins(unittest.TestCase):
self.assertEqual(plugin_conf['class'],
'mailman.testing.plugin.ExamplePlugin')
self.assertEqual(plugin_conf['path'], '')
+ self.assertEqual(plugin_conf['configuration'], '')
def test_non_existent_plugin(self):
with self.assertRaises(HTTPError) as cm: