summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJ08nY2017-08-07 17:27:18 +0200
committerJ08nY2017-08-07 17:27:18 +0200
commitf00624e069f56f452ba588429bb7e42070e7ee70 (patch)
treefa80b41db5e265d474f952deab9c71ad6eb62cc2 /src
parent10e4b784f51d437429ffb49a937fa68a1ad33bbe (diff)
downloadmailman-pgp-f00624e069f56f452ba588429bb7e42070e7ee70.tar.gz
mailman-pgp-f00624e069f56f452ba588429bb7e42070e7ee70.tar.zst
mailman-pgp-f00624e069f56f452ba588429bb7e42070e7ee70.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman_pgp/plugin.py6
-rw-r--r--src/mailman_pgp/testing/start.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/mailman_pgp/plugin.py b/src/mailman_pgp/plugin.py
index 7ee31e2..639de93 100644
--- a/src/mailman_pgp/plugin.py
+++ b/src/mailman_pgp/plugin.py
@@ -16,6 +16,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
"""A PGP plugin for GNU Mailman."""
+import warnings
from mailman.interfaces.plugin import IPlugin
from public import public
@@ -34,11 +35,16 @@ class PGPMailman:
def pre_hook(self):
"""See `IPlugin`."""
+ # Load the config.
config.load(self.name)
config.validate()
config.convert()
+ # Load module global stuff and attach it to the config.
config.db = Database()
config.pgp = PGP()
+ # Mute PGPy, it gives UserWarnings even during normal use.
+ warnings.filterwarnings(action='ignore', category=UserWarning,
+ module='.*pgpy.*')
def post_hook(self):
"""See `IPlugin`."""
diff --git a/src/mailman_pgp/testing/start.py b/src/mailman_pgp/testing/start.py
index 128855e..dbc4ece 100644
--- a/src/mailman_pgp/testing/start.py
+++ b/src/mailman_pgp/testing/start.py
@@ -26,4 +26,4 @@ def start_run(plugin):
warnings.filterwarnings(action='ignore', category=UserWarning,
module='.*mailman_pgp.*')
warnings.filterwarnings(action='ignore', category=UserWarning,
- module='.*PGPy.*')
+ module='.*pgpy.*')