Changeset 354 for trunk/email2trac.py.in


Ignore:
Timestamp:
04/15/10 14:09:29 (14 years ago)
Author:
bas
Message:

Some modification of ticket subject updates, see #188

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r353 r354  
    12311231
    12321232                                # This list of Re: prefixes is probably incomplete. Taken from
    1233                                 # wikipedia.
    1234                                 re_regex = re.compile(r'^(RE|AW|VS|SV):\s*(.*)', re.IGNORECASE)
    1235                                 result = re_regex.search(subject)
    1236                                 print result
     1233                                # wikipedia. Here is how the subject is matched
     1234                                #   Re: <subject>
     1235                                #   Re: (<Mail list label>:)+ <subject>
     1236                                #
     1237                                # So we must have column 3
     1238                       
     1239                               
     1240                                SUBJECT_RE = re.compile(r'^(RE|AW|VS|SV):(.*:)*\s*(.*)', re.IGNORECASE)
     1241                                result = SUBJECT_RE.search(subject)
    12371242
    12381243                                if result:
    12391244                                        # This is a reply
    1240                                         orig_subject = result.group(2)
    1241                                         print orig_subject
     1245                                        orig_subject = result.group(3)
     1246                                        if self.DEBUG:
     1247                                                print 'TD: subject search string: %s' %(orig_subject)
     1248
    12421249                                        cursor = self.db.cursor()
    12431250
Note: See TracChangeset for help on using the changeset viewer.