+# -*- coding: utf-8 -*-
+
from trac.core import *
from trac.ticket import ITicketChangeListener
import subprocess
+import re
import textwrap
import shlex
zclass = self.config.get('ZephyrPlugin', 'class')
if zclass == '':
return
- command = shlex.split(self.config.get('ZephyrPlugin', 'command'))
+ command = shlex.split(self.config.get('ZephyrPlugin', 'command').encode('utf-8'))
if not command:
command = ['zwrite', '-q', '-l', '-d']
p = subprocess.Popen(command +
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'[…]']
self.zwrite(ticket.id, message)
def ticket_changed(self, ticket, comment, author, old_values):
- message = ''
+ message = "(%s)\n" % ticket['summary']
for field in ticket.fields:
name = field['name']
if name not in old_values: