From: Anders Kaseorg Date: Tue, 8 Sep 2009 17:19:58 +0000 (-0400) Subject: TracZephyrPlugin: Snip quoted text in replies. X-Git-Url: https://sipb.mit.edu/gitweb.cgi/snippets/.git/commitdiff_plain/b9d0b6557da79c6a0655a9a33e8259270c84b081 TracZephyrPlugin: Snip quoted text in replies. Signed-off-by: Anders Kaseorg --- diff --git a/TracZephyrPlugin/ZephyrPlugin.py b/TracZephyrPlugin/ZephyrPlugin.py index 9792da4..45584ae 100644 --- a/TracZephyrPlugin/ZephyrPlugin.py +++ b/TracZephyrPlugin/ZephyrPlugin.py @@ -3,6 +3,7 @@ from trac.core import * from trac.ticket import ITicketChangeListener import subprocess +import re import textwrap import shlex @@ -25,6 +26,7 @@ class ZephyrPlugin(Component): p.wait() def format_text(self, text): + text = re.sub(re.compile('^(?:> .*\n)+', re.MULTILINE), u'> […]\n', text) lines = textwrap.fill(text).split('\n') if len(lines) > 5: lines = lines[:5] + [u'[…]']