Changeset 607
- Timestamp:
- 08/30/12 15:31:46 (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r606 r607 37 37 38 38 * Added a new option 'strip_signature_regex', default value: 39 * '^-----Original Message-----$|^-- $'39 * strip_signature_regex : ^-----Original Message-----$|^-- $ 40 40 This will strip signatures form the email messages. People can set their own regular 41 41 expressions, closes #296, #155 42 42 Author: steverweber add gmail dot com 43 Appplied by: Bas van der Vlies 43 Applied by: Bas van der Vlies 44 45 * email_quote can now handle regular expresions, default is: 46 email_quote : ^> .* 47 We now use the re.match function instead of line.startswith, closes #173 48 Suggested/Patch by: samuel add hoffstaetter dot com 49 Applied by: Bas van der Vlies 44 50 45 51 2.5.0 -
trunk/email2trac.py.in
r606 r607 182 182 183 183 if not self.parameters.email_quote: 184 self.parameters.email_quote = ' >'184 self.parameters.email_quote = '^> .*' 185 185 186 186 if not self.parameters.ticket_update_by_subject_lookback: … … 1876 1876 Strip signature from message, inspired by Mailman software 1877 1877 """ 1878 self.logger.debug('function strip_signature ')1878 self.logger.debug('function strip_signature: %s' %self.parameters.strip_signature_regex) 1879 1879 1880 1880 body = [] … … 1938 1938 Strip quotes from message by Nicolas Mendoza 1939 1939 """ 1940 self.logger.debug('function strip_quotes ')1940 self.logger.debug('function strip_quotes: %s' %self.parameters.email_quote) 1941 1941 1942 1942 body = [] 1943 1944 STRIP_RE = re.compile( self.parameters.email_quote ) 1945 1943 1946 for line in text.splitlines(): 1947 1944 1948 try: 1945 1949 1946 if line.startswith(self.parameters.email_quote): 1950 match = STRIP_RE.match(line) 1951 if match: 1952 print line 1947 1953 continue 1948 1954 … … 1950 1956 1951 1957 tmp_line = self.email_to_unicode(line) 1952 if tmp_line.startswith(self.parameters.email_quote): 1958 1959 match = STRIP_RE.match(tmp_line) 1960 if match: 1961 print line 1953 1962 continue 1954 1963
Note: See TracChangeset
for help on using the changeset viewer.