Update of /cvsroot/tmda/tmda/TMDA/pythonlib/email
In directory sc8-pr-cvs1:/tmp/cvs-serv20912
Modified Files:
__init__.py _compat21.py _compat22.py
Log Message:
Sync email with Python CVS. Fixes the Python 2.2 compatability
problem.
Index: __init__.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/pythonlib/email/__init__.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- __init__.py 22 Mar 2003 20:42:52 -0000 1.7
+++ __init__.py 26 Mar 2003 19:02:09 -0000 1.8
@@ -4,7 +4,7 @@
"""A package for parsing, handling, and generating email messages.
"""
-__version__ = '2.5'
+__version__ = '2.5+'
__all__ = [
'base64MIME',
Index: _compat21.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/pythonlib/email/_compat21.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- _compat21.py 12 Mar 2003 03:29:49 -0000 1.4
+++ _compat21.py 26 Mar 2003 19:02:09 -0000 1.5
@@ -63,7 +63,7 @@
"""
parts = []
for subpart in msg.walk():
- if subpart.get_main_type('text') == maintype:
- if subtype is None or subpart.get_subtype('plain') == subtype:
+ if subpart.get_content_maintype() == maintype:
+ if subtype is None or subpart.get_content_subtype() == subtype:
parts.append(subpart)
return parts
Index: _compat22.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/pythonlib/email/_compat22.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- _compat22.py 11 Mar 2003 20:39:03 -0000 1.2
+++ _compat22.py 26 Mar 2003 19:02:10 -0000 1.3
@@ -1,7 +1,7 @@
# Copyright (C) 2002 Python Software Foundation
# Author: [EMAIL PROTECTED]
-"""Module containing compatibility functions for Python 2.1.
+"""Module containing compatibility functions for Python 2.2.
"""
from __future__ import generators
@@ -9,6 +9,13 @@
from cStringIO import StringIO
from types import StringTypes
+# Python 2.2.x where x < 2 lacks True/False
+try:
+ True, False
+except NameError:
+ True = 1
+ False = 0
+
# This function will become a method of the Message class
@@ -58,6 +65,6 @@
omitted, only the main type is matched.
"""
for subpart in msg.walk():
- if subpart.get_main_type('text') == maintype:
- if subtype is None or subpart.get_subtype('plain') == subtype:
+ if subpart.get_content_maintype() == maintype:
+ if subtype is None or subpart.get_content_subtype() == subtype:
yield subpart
_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs