]> snippets.scripts.mit.edu Git - Scripts/git/.git/commitdiff
TracZephyrPlugin: Snip quoted text in replies.
authorAnders Kaseorg <andersk@mit.edu>
Tue, 8 Sep 2009 17:19:58 +0000 (13:19 -0400)
committerAnders Kaseorg <andersk@mit.edu>
Tue, 8 Sep 2009 17:19:58 +0000 (13:19 -0400)
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
TracZephyrPlugin/ZephyrPlugin.py

index 9792da4baae2927b69e7c5358823c28e4ac32f00..45584ae80bda02ead02c4e558a8a877b46eb34c2 100644 (file)
@@ -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'[…]']