summaryrefslogtreecommitdiff
path: root/src/mailman_pgp/plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/plugin.py')
-rw-r--r--src/mailman_pgp/plugin.py6
1 files changed, 6 insertions, 0 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`."""