Update of /cvsroot/mailman/mailman/Mailman/Handlers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9406

Modified Files:
        Decorate.py Scrubber.py Tagger.py 
Log Message:
Preparing for email 3.0/4.0.  get_type() -> get_content_type() etc.


Index: Decorate.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Decorate.py,v
retrieving revision 2.27
retrieving revision 2.28
diff -u -d -r2.27 -r2.28
--- Decorate.py 29 Jan 2006 05:13:57 -0000      2.27
+++ Decorate.py 7 Mar 2006 12:43:13 -0000       2.28
@@ -121,7 +121,7 @@
             wrap = False
         except (LookupError, UnicodeError):
             pass
-    elif msg.get_type() == 'multipart/mixed':
+    elif msg.get_content_type() == 'multipart/mixed':
         # The next easiest thing to do is just prepend the header and append
         # the footer as additional subparts
         payload = msg.get_payload()

Index: Scrubber.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Scrubber.py,v
retrieving revision 2.34
retrieving revision 2.35
diff -u -d -r2.34 -r2.35
--- Scrubber.py 19 Feb 2006 21:03:59 -0000      2.34
+++ Scrubber.py 7 Mar 2006 12:43:13 -0000       2.35
@@ -188,7 +188,7 @@
     lcset_out = Charset(lcset).output_charset or lcset
     # Now walk over all subparts of this message and scrub out various types
     for part in msg.walk():
-        ctype = part.get_type(part.get_default_type())
+        ctype = part.get_content_type()
         # If the part is text/plain, we leave it alone
         if ctype == 'text/plain':
             # We need to choose a charset for the scrubbed message, so we'll
@@ -286,7 +286,7 @@
         # will transform the url into a hyperlink.
         elif part and not part.is_multipart():
             payload = part.get_payload(decode=True)
-            ctype = part.get_type()
+            ctype = part.get_content_type()
             # XXX Under email 2.5, it is possible that payload will be None.
             # This can happen when you have a Content-Type: multipart/* with
             # only one part and that part has two blank lines between the

Index: Tagger.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Tagger.py,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -d -r2.6 -r2.7
--- Tagger.py   27 Aug 2005 01:54:02 -0000      2.6
+++ Tagger.py   7 Mar 2006 12:43:13 -0000       2.7
@@ -69,11 +69,12 @@
     # 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.get_type('text/plain') == 'text/plain':
+    if msg.get_content_type() == 'text/plain':
         found = msg
-    elif msg.is_multipart() and msg.get_type() == 'multipart/alternative':
+    elif msg.is_multipart()\
+         and msg.get_content_type() == 'multipart/alternative':
         for found in msg.get_payload():
-            if found.get_type('text/plain') == 'text/plain':
+            if found.get_content_type() == 'text/plain':
                 break
         else:
             found = None

_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to