Changeset 606 for trunk/email2trac.py.in


Ignore:
Timestamp:
08/30/12 14:31:39 (10 years ago)
Author:
bas
Message:

added strip_signature_regex option, closes #296, #155

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r605 r606  
    220220            self.parameters.subject_field_separator = self.parameters.subject_field_separator.strip()
    221221
     222        if not self.parameters.strip_signature_regex:
     223            self.parameters.strip_signature_regex = '^-----Original Message-----$|^-- $'
     224
     225
    222226        self.trac_smtp_from = self.get_config('notification', 'smtp_from')
    223227        self.smtp_default_domain = self.get_config('notification', 'smtp_default_domain')
     
    18751879
    18761880        body = []
     1881
     1882        STRIP_RE = re.compile( self.parameters.strip_signature_regex )
    18771883        for line in text.splitlines():
    1878             if line == '-- ':
     1884
     1885            match = STRIP_RE.match(line)
     1886            if match:
     1887                self.logger.debug('\t"%s "  matched, skiping rest of message' %line)
    18791888                break
     1889
    18801890            body.append(line)
    18811891
Note: See TracChangeset for help on using the changeset viewer.