X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;ds=inline;f=apps%2Fpatchwork%2Fbin%2Fparsemail.py;h=b0f1497656ab8ac4170c93f34975454b4f9b0fad;hb=5787cddc0bde4514cba96a360f89841e13d2e506;hp=3fbe4735101c31e31a4d5b6c9384e910b062f339;hpb=ae13beca83bcd061d7b0158ed4bdd45abf2eb855;p=patchwork diff --git a/apps/patchwork/bin/parsemail.py b/apps/patchwork/bin/parsemail.py index 3fbe473..b0f1497 100755 --- a/apps/patchwork/bin/parsemail.py +++ b/apps/patchwork/bin/parsemail.py @@ -103,7 +103,6 @@ def find_author(mail): def mail_date(mail): t = parsedate_tz(mail.get('Date', '')) if not t: - print "using now()" return datetime.datetime.utcnow() return datetime.datetime.utcfromtimestamp(mktime_tz(t)) @@ -299,8 +298,9 @@ def clean_subject(subject, drop_prefixes = None): return subject -sig_re = re.compile('^(-{2,3} ?|_+)\n.*', re.S | re.M) +sig_re = re.compile('^(-- |_+)\n.*', re.S | re.M) def clean_content(str): + """ Try to remove signature (-- ) and list footer (_____) cruft """ str = sig_re.sub('', str) return str.strip()