summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 065f3a3)
raw | patch | inline | side by side (parent: 065f3a3)
author | neaj <neaj@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 23 Jun 2003 08:37:15 +0000 (08:37 +0000) | ||
committer | neaj <neaj@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 23 Jun 2003 08:37:15 +0000 (08:37 +0000) |
overridden in an instance's interfaces.MailGW, and wrote subject_re as a
re.VERBOSE, with a couple of comments.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1746 57a73879-2fb5-44c3-a270-3262357dd7e2
re.VERBOSE, with a couple of comments.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1746 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/mailgw.py | patch | blob | history |
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 1e2448599ad14545c80bb6d4b02b90b77b94284a..eee37cb922312f31e06ec36ac98e553592dad9bb 100644 (file)
--- a/roundup/mailgw.py
+++ b/roundup/mailgw.py
an exception, the original message is bounced back to the sender with the
explanatory message given in the exception.
-$Id: mailgw.py,v 1.123 2003-06-18 23:34:52 richard Exp $
+$Id: mailgw.py,v 1.124 2003-06-23 08:37:15 neaj Exp $
'''
import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
hdr = mimetools.Message.getheader(self, name, default)
return rfc2822.decode_header(hdr)
-subject_re = re.compile(r'(?P<refwd>\s*\W?\s*(fw|fwd|re|aw)\W\s*)*'
- r'\s*(?P<quote>")?(\[(?P<classname>[^\d\s]+)(?P<nodeid>\d+)?\])?'
- r'\s*(?P<title>[^[]+)?"?(\[(?P<args>.+?)\])?', re.I)
-
class MailGW:
+
+ # Matches subjects like:
+ # Re: "[issue1234] title of issue [status=resolved]"
+ subject_re = re.compile(r'''
+ (?P<refwd>\s*\W?\s*(fw|fwd|re|aw)\W\s*)*\s* # Re:
+ (?P<quote>")? # Leading "
+ (\[(?P<classname>[^\d\s]+) # [issue..
+ (?P<nodeid>\d+)? # ..1234]
+ \])?\s*
+ (?P<title>[^[]+)? # issue title
+ "? # Trailing "
+ (\[(?P<args>.+?)\])? # [prop=value]
+ ''', re.IGNORECASE|re.VERBOSE)
+
def __init__(self, instance, db, arguments={}):
self.instance = instance
self.db = db
if subject.strip().lower() == 'help':
raise MailUsageHelp
- m = subject_re.match(subject)
+ m = self.subject_re.match(subject)
# check for well-formed subject line
if m: