Changeset 606 for trunk


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

added strip_signature_regex option, closes #296, #155

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r604 r606  
    3434    strip_quotes and strip_signature for ticket updates, closes #192
    3535    Requested by, Patch:  Konstantin Ryabitsev <icon add mricon dot com>
     36    Appplied by: Bas van der Vlies
     37
     38  * Added a new option 'strip_signature_regex', default value:
     39      * '^-----Original Message-----$|^-- $'
     40    This will strip signatures form the email messages. People can set their own regular
     41    expressions, closes #296, #155
     42    Author: steverweber add gmail dot com
    3643    Appplied by: Bas van der Vlies
    3744
  • 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
  • trunk/msg.txt

    r72 r606  
    2929
    3030--
    31 --
    3231********************************************************************
    3332*                                                                  *
Note: See TracChangeset for help on using the changeset viewer.