From b9d0b6557da79c6a0655a9a33e8259270c84b081 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 8 Sep 2009 13:19:58 -0400 Subject: [PATCH] TracZephyrPlugin: Snip quoted text in replies. Signed-off-by: Anders Kaseorg --- TracZephyrPlugin/ZephyrPlugin.py | 2 ++ 1 file changed, 2 insertions(+) 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'[…]'] -- 2.45.0