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

Modified Files:
      Tag: Release_2_1-maint
        ToDigest.py 
Log Message:
oneline() has moved to Utils.py (sorry for the last bogus commit).


Index: ToDigest.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/ToDigest.py,v
retrieving revision 2.22.2.5
retrieving revision 2.22.2.6
diff -u -d -r2.22.2.5 -r2.22.2.6
--- ToDigest.py 16 Dec 2003 05:11:07 -0000      2.22.2.5
+++ ToDigest.py 18 Sep 2004 06:48:46 -0000      2.22.2.6
@@ -215,14 +215,14 @@
         messages.append(msg)
         # Get the Subject header
         msgsubj = msg.get('subject', _('(no subject)'))
-        subject = oneline(msgsubj, lcset)
+        subject = Utils.oneline(msgsubj, lcset)
         # Don't include the redundant subject prefix in the toc
         mo = re.match('(re:? *)?(%s)' % re.escape(mlist.subject_prefix),
                       subject, re.IGNORECASE)
         if mo:
             subject = subject[:mo.start(2)] + subject[mo.end(2):]
         username = ''
-        addresses = getaddresses([oneline(msg.get('from', ''), lcset)])
+        addresses = getaddresses([Utils.oneline(msg.get('from', ''), lcset)])
         # Take only the first author we find
         if isinstance(addresses, ListType) and addresses:
             username = addresses[0][0]
@@ -310,7 +310,7 @@
         # Honor the default setting
         for h in mm_cfg.PLAIN_DIGEST_KEEP_HEADERS:
             if msg[h]:
-                uh = Utils.wrap('%s: %s' % (h, oneline(msg[h], lcset)))
+                uh = Utils.wrap('%s: %s' % (h, Utils.oneline(msg[h], lcset)))
                 uh = '\n\t'.join(uh.split('\n'))
                 print >> plainmsg, uh
         print >> plainmsg
@@ -380,16 +380,3 @@
                     recips=plainrecips,
                     listname=mlist.internal_name(),
                     isdigest=True)
-
-
-
-def oneline(s, cset):
-    # Decode header string in one line and convert into specified charset
-    try:
-        h = make_header(decode_header(s))
-        ustr = h.__unicode__()
-        oneline = UEMPTYSTRING.join(ustr.splitlines())
-        return oneline.encode(cset, 'replace')
-    except (LookupError, UnicodeError):
-        # possibly charset problem. return with undecoded string in one line.
-        return EMPTYSTRING.join(s.splitlines())

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

Reply via email to