~sambuddhabasu1/mailman/fix_mailman_run_error

« back to all changes in this revision

Viewing changes to Mailman/Handlers/Acknowledge.py

  • Committer: bwarsaw
  • Date: 2007-03-21 14:11:53 UTC
  • Revision ID: vcs-imports@canonical.com-20070321141153-chq79cj8kdnvku1p
Test suite repair.  All tests are now passing again.

- In i18n.py, change this method so that everything it returns will be
  guaranteed to be a unicode.  Mailman 2.2 will be unicode-safe, meaning all
  strings internally will be unicodes.  The translation service is one
  boundary point were strings come from the outside, so ensure that they are
  unicodes and convert if necessary.  This may break some things, but it's
  better to fix those situations than to continue to return 8-bit strings from
  _().

- In Mailman/testing/base.py, craft a fake module called Mailman.MTA.stub and
  stick no-op functions on stub.create() and stub.remove().  We really don't
  need the MTA modules for testing purposes (yet at least), and if you're
  using the default configuration, you'll get tons of cruft on stdout when the
  Manual MTA tries to add and remove mailing lists.

  Set up the test configuration environment to use this stub MTA module.

- In test_handlers.py, remove an extraneous str().

- Convert ToDigest.py, Hold.py and Acknowledge.py to __i18n_templates__.  (I'm
  pretty darn close to just making everything use $-strings by default.)

- In CookHeaders.py, there's no need to unicode()-ify the subject since that
  should already be a unicode when passed from _().

- In MailList.py, we can use the str.capitalize() method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from Mailman.configuration import config
30
30
from Mailman.i18n import _
31
31
 
 
32
__i18n_templates__ = True
 
33
 
32
34
 
33
35
 
34
36
def process(mlist, msg, msgdata):
57
59
    # Craft the outgoing message, with all headers and attributes
58
60
    # necessary for general delivery.  Then enqueue it to the outgoing
59
61
    # queue.
60
 
    subject = _('%(realname)s post acknowledgement')
 
62
    subject = _('$realname post acknowledgement')
61
63
    usermsg = Message.UserNotification(sender, mlist.GetBouncesEmail(),
62
64
                                       subject, text, lang)
63
65
    usermsg.send(mlist)