]> snippets.scripts.mit.edu Git - Scripts/git/.git/blobdiff - TracZephyrPlugin/ZephyrPlugin.py
TracZephyrPlugin: Snip quoted text in replies.
[Scripts/git/.git] / 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'[…]']