summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2000-12-20 21:40:09 +0000
committerbwarsaw2000-12-20 21:40:09 +0000
commit3281c4603f2741876d0fe6597d6a29b99af73322 (patch)
tree14f3ea6509c70a7403323c06d4bda8fa901ae9f3
parente43a9151a311bf5c7f4355dd1cf400c00f8929f5 (diff)
downloadmailman-3281c4603f2741876d0fe6597d6a29b99af73322.tar.gz
mailman-3281c4603f2741876d0fe6597d6a29b99af73322.tar.zst
mailman-3281c4603f2741876d0fe6597d6a29b99af73322.zip
process(): Get rid of the string module in favor of string methods.
-rw-r--r--Mailman/Handlers/Decorate.py6
-rw-r--r--Mailman/Handlers/Replybot.py11
-rw-r--r--Mailman/Handlers/ToArchive.py5
3 files changed, 10 insertions, 12 deletions
diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py
index b953def7a..b2e957161 100644
--- a/Mailman/Handlers/Decorate.py
+++ b/Mailman/Handlers/Decorate.py
@@ -17,8 +17,6 @@
"""Decorate a message by sticking the header and footer around it.
"""
-import string
-
from Mailman import mm_cfg
from Mailman import Utils
from Mailman.Logging.Syslog import syslog
@@ -33,12 +31,12 @@ def process(mlist, msg, msgdata):
d['cgiext'] = mm_cfg.CGIEXT
# interpolate into the header
try:
- header = string.replace(mlist.msg_header % d, '\r\n', '\n')
+ header = (mlist.msg_header % d).replace('\r\n', '\n')
except ValueError, e:
syslog('error', 'Exception while calculating message header:\n%s' % e)
header = '[INVALID HEADER]'
try:
- footer = string.replace(mlist.msg_footer % d, '\r\n', '\n')
+ footer = (mlist.msg_footer % d).replace('\r\n', '\n')
except ValueError, e:
syslog('error', 'Exception while calculating message footer:\n%s' % e)
footer = '[INVALID FOOTER]'
diff --git a/Mailman/Handlers/Replybot.py b/Mailman/Handlers/Replybot.py
index e8eb8141a..9152f5f1e 100644
--- a/Mailman/Handlers/Replybot.py
+++ b/Mailman/Handlers/Replybot.py
@@ -17,18 +17,19 @@
"""Handler for auto-responses.
"""
-import string
import time
import HandlerAPI
from Mailman import Utils
from Mailman import Message
+NL = '\n'
+
def process(mlist, msg, msgdata):
# "X-Ack: No" header in the original message disables the replybot
- ack = string.lower(msg.get('x-ack', ''))
+ ack = msg.get('x-ack', '').lower()
if ack == 'no' or msgdata.get('noack'):
return
#
@@ -81,10 +82,10 @@ def process(mlist, msg, msgdata):
# and body will be mixed up. The fix is to include a blank delimiting
# line at the front of the wrapped text.
text = Utils.wrap(text)
- lines = string.split(text, '\n')
- if string.find(lines[0], ':') >= 0:
+ lines = text.split('\n')
+ if lines[0].find(':') >= 0:
lines.insert(0, '')
- text = string.join(lines, '\n')
+ text = NL.join(lines)
outmsg = Message.UserNotification(sender, mlist.GetAdminEmail(),
subject, text)
outmsg['X-Mailer'] = 'The Mailman Replybot '
diff --git a/Mailman/Handlers/ToArchive.py b/Mailman/Handlers/ToArchive.py
index 05ad920cd..3a6cc772b 100644
--- a/Mailman/Handlers/ToArchive.py
+++ b/Mailman/Handlers/ToArchive.py
@@ -16,7 +16,6 @@
"""Add the message to the archives."""
-import string
import time
@@ -27,8 +26,8 @@ def process(mlist, msg, msgdata):
return
# Common practice seems to favor "X-No-Archive: yes". I'm keeping
# "X-Archive: no" for backwards compatibility.
- if string.lower(msg.getheader('x-no-archive', '')) == 'yes' or \
- string.lower(msg.getheader('x-archive', '')) == 'no':
+ if msg.getheader('x-no-archive', '').lower() == 'yes' or \
+ msg.getheader('x-archive', '').lower() == 'no':
return
#
# TBD: This is a kludge around the archiver to properly support