summaryrefslogtreecommitdiff
path: root/src/mailman/pipeline/decorate.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-12-14 22:49:47 -0500
committerBarry Warsaw2009-12-14 22:49:47 -0500
commit7592ba511e37a299e3329f95e584873f3613dc5f (patch)
treed7b11c6d0ebbb5006d1ff12a1829659a05dbfb17 /src/mailman/pipeline/decorate.py
parent91020e5c0b7cc70b12d16741bd415b5eb017b63e (diff)
downloadmailman-7592ba511e37a299e3329f95e584873f3613dc5f.tar.gz
mailman-7592ba511e37a299e3329f95e584873f3613dc5f.tar.zst
mailman-7592ba511e37a299e3329f95e584873f3613dc5f.zip
Diffstat (limited to 'src/mailman/pipeline/decorate.py')
-rw-r--r--src/mailman/pipeline/decorate.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mailman/pipeline/decorate.py b/src/mailman/pipeline/decorate.py
index 65badcd4a..b929a8e64 100644
--- a/src/mailman/pipeline/decorate.py
+++ b/src/mailman/pipeline/decorate.py
@@ -28,11 +28,10 @@ __all__ = [
import re
import logging
-from email.MIMEText import MIMEText
+from email.mime.text import MIMEText
from zope.component import getUtility
from zope.interface import implements
-from mailman.config import config
from mailman.core.i18n import _
from mailman.email.message import Message
from mailman.interfaces.handler import IHandler
@@ -45,7 +44,8 @@ log = logging.getLogger('mailman.error')
def process(mlist, msg, msgdata):
- # Digests and Mailman-craft messages should not get additional headers
+ """Decorate the message with headers and footers."""
+ # Digests and Mailman-craft messages should not get additional headers.
if msgdata.get('isdigest') or msgdata.get('nodecorate'):
return
d = {}
@@ -96,7 +96,7 @@ def process(mlist, msg, msgdata):
wrap = True
if not msg.is_multipart() and msgtype == 'text/plain':
# Save the RFC-3676 format parameters.
- format = msg.get_param('format')
+ format_param = msg.get_param('format')
delsp = msg.get_param('delsp')
# Save 'Content-Transfer-Encoding' header in case decoration fails.
cte = msg.get('content-transfer-encoding')
@@ -120,8 +120,8 @@ def process(mlist, msg, msgdata):
except UnicodeError:
pass
else:
- if format:
- msg.set_param('format', format)
+ if format_param:
+ msg.set_param('format', format_param)
if delsp:
msg.set_param('delsp', delsp)
wrap = False
@@ -196,6 +196,7 @@ def process(mlist, msg, msgdata):
def decorate(mlist, template, extradict=None):
+ """Expand the decoration template."""
# Create a dictionary which includes the default set of interpolation
# variables allowed in headers and footers. These will be augmented by
# any key/value pairs in the extradict.
@@ -216,6 +217,7 @@ def decorate(mlist, template, extradict=None):
+# pylint: disable-msg=W0232,R0201
class Decorate:
"""Decorate a message with headers and footers."""