CVS: tmda/TMDA/pythonlib/email Message.py,1.7,1.8

"Jason R. Mastaler" <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda/TMDA/pythonlib/email
In directory sc8-pr-cvs1:/tmp/cvs-serv13738

Modified Files:
	Message.py 
Log Message:
sync with Python CVS

Index: Message.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/pythonlib/email/Message.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Message.py	19 Aug 2003 18:53:15 -0000	1.7
+++ Message.py	5 Oct 2003 06:57:48 -0000	1.8
@@ -58,6 +58,23 @@
     else:
         return param
 
+def _parseparam(s):
+    plist = []
+    while s[:1] == ';':
+        s = s[1:]
+        end = s.find(';')
+        while end > 0 and s.count('"', 0, end) % 2:
+            end = s.find(';', end + 1)
+        if end < 0:
+            end = len(s)
+        f = s[:end]
+        if '=' in f:
+            i = f.index('=')
+            f = f[:i].strip().lower() + '=' + f[i+1:].strip()
+        plist.append(f.strip())
+        s = s[end:]
+    return plist
+
 
 def _unquotevalue(value):
     if isinstance(value, TupleType):
@@ -525,7 +542,7 @@
         if value is missing:
             return failobj
         params = []
-        for p in paramre.split(value):
+        for p in _parseparam(';' + value):
             try:
                 name, val = p.split('=', 1)
                 name = name.strip()

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.