@@ -149,7 +149,6 @@ def find_pull_request(content):
return match.group(1)
return None
-
def try_decode(payload, charset):
try:
payload = unicode(payload, charset)
@@ -157,6 +156,20 @@ def try_decode(payload, charset):
return None
return payload
+def strip_signature(text):
+ if not text:
+ return
+
+ buf = ''
+ for line in text.splitlines(True):
+ if line == '-- \n':
+ break
+ buf += line
+
+ if buf == '':
+ return None
+ return buf.strip()
+
class MailContent:
def __init__(self):
self.patch = None
@@ -245,6 +258,8 @@ def find_content(project, mail):
if c is not None:
commentbuf += c.strip() + '\n'
+ commentbuf = strip_signature(commentbuf)
+
ret = MailContent()
if pullurl or patchbuf:
Those signature don't really add value to the comment. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> --- patchwork/bin/parsemail.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)