From ae3d0cc316b826b8325507d960ccf84da601c3b0 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 16 Jan 2009 21:04:21 -0500 Subject: Several important cleanups. * Turn on absolute_import and unicode_literals everywhere, and deal with the aftermath. * Use 'except X as Y' everywhere. * Make the module prologues much more consistent. * Use '{}'.format() consistently, except for logger interface. * Because of the problems with calling ** args with unicode keywords, hide calls to Template.substitute() behind an API. --- mailman/pipeline/replybot.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mailman/pipeline/replybot.py') diff --git a/mailman/pipeline/replybot.py b/mailman/pipeline/replybot.py index ee0894d12..e24777774 100644 --- a/mailman/pipeline/replybot.py +++ b/mailman/pipeline/replybot.py @@ -17,21 +17,25 @@ """Handler for auto-responses.""" +from __future__ import absolute_import, unicode_literals + __metaclass__ = type -__all__ = ['Replybot'] +__all__ = [ + 'Replybot', + ] import time import logging import datetime -from string import Template from zope.interface import implements from mailman import Message from mailman import Utils from mailman.i18n import _ from mailman.interfaces.handler import IHandler +from mailman.utilities.string import expand log = logging.getLogger('mailman.error') @@ -97,7 +101,7 @@ def process(mlist, msg, msgdata): else: rtext = mlist.autoresponse_postings_text # Interpolation and Wrap the response text. - text = Utils.wrap(Template(rtext).safe_substitute(d)) + text = Utils.wrap(expand(rtext, d)) outmsg = Message.UserNotification(sender, mlist.bounces_address, subject, text, mlist.preferred_language) outmsg['X-Mailer'] = _('The Mailman Replybot') -- cgit v1.2.3-70-g09d2