From c6486ef10753ccdc20adb9ba44c15f4fdf91c13e Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 9 Oct 2001 23:17:39 +0000 Subject: process(), scanbody(): mimelib -> email. --- Mailman/Handlers/Tagger.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Mailman/Handlers/Tagger.py b/Mailman/Handlers/Tagger.py index 220dd884f..005f3760b 100644 --- a/Mailman/Handlers/Tagger.py +++ b/Mailman/Handlers/Tagger.py @@ -24,7 +24,7 @@ import email.Iterators from Mailman.Logging.Syslog import syslog CRNL = '\r\n' -NL = '\n' +EMPTYSTRING = '' NLTAB = '\n\t' @@ -67,11 +67,11 @@ def scanbody(msg, numlines=None): # or if the outer type is multipart/alternative and there is a text/plain # part. Anything else, and the body is ignored for header-scan purposes. found = None - if msg.gettype('text/plain') == 'text/plain': + if msg.get_type('text/plain') == 'text/plain': found = msg - elif msg.ismultipart() and msg.gettype() == 'multipart/alternative': + elif msg.is_multipart() and msg.get_type() == 'multipart/alternative': for found in msg.get_payload(): - if found.gettype('text/plain') == 'text/plain': + if found.get_type('text/plain') == 'text/plain': break else: found = None @@ -98,5 +98,5 @@ def scanbody(msg, numlines=None): lines.append(line) # Concatenate those body text lines with newlines, and then create a new # message object from those lines. - msg = email.message_from_string(NL.join(lines)) - return msg.getall('subject', []) + msg.getall('keywords', []) + msg = email.message_from_string(EMPTYSTRING.join(lines)) + return msg.get_all('subject', []) + msg.get_all('keywords', []) -- cgit v1.3.1