~barry/mailman/events-and-web

« back to all changes in this revision

Viewing changes to src/mailman/handlers/decorate.py

  • Committer: Barry Warsaw
  • Date: 2012-04-26 02:08:22 UTC
  • Revision ID: barry@list.org-20120426020822-g5shyz6tr3gwkmiw
General code cleanup.

 - Add explicit dependency on zope.event in setup.py.
 - Use Python 3 compatible syntax for specifying that a class implements an
   interface, i.e. the @implementer class decorator.
 - print_function futures.
 - Whitespace normalization.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
from email.mime.text import MIMEText
32
32
from urllib2 import URLError
33
33
from zope.component import getUtility
34
 
from zope.interface import implements
 
34
from zope.interface import implementer
35
35
 
36
36
from mailman.core.i18n import _
37
37
from mailman.email.message import Message
57
57
        d['user_address'] = recipient
58
58
        d['user_delivered_to'] = member.address.original_email
59
59
        d['user_language'] = member.preferred_language.description
60
 
        d['user_name'] = (member.user.display_name 
 
60
        d['user_name'] = (member.user.display_name
61
61
                          if member.user.display_name
62
62
                          else member.address.original_email)
63
63
        d['user_optionsurl'] = member.options_url
232
232
 
233
233
 
234
234
 
 
235
@implementer(IHandler)
235
236
class Decorate:
236
237
    """Decorate a message with headers and footers."""
237
238
 
238
 
    implements(IHandler)
239
 
 
240
239
    name = 'decorate'
241
240
    description = _('Decorate a message with headers and footers.')
242
241