from trac.ticket import ITicketChangeListener
import subprocess
import textwrap
+import shlex
class ZephyrPlugin(Component):
implements(ITicketChangeListener)
zclass = self.config.get('ZephyrPlugin', 'class')
if zclass == '':
return
- command = self.config.get('ZephyrPlugin', 'command').split(' ')
+ command = shlex.split(self.config.get('ZephyrPlugin', 'command'))
if not command:
command = ['zwrite', '-q', '-l', '-d']
p = subprocess.Popen(command +
['-c', zclass,
'-i', 'trac-#%s' % id],
stdin=subprocess.PIPE)
- p.stdin.write(message.encode('utf-8', 'replace'))
+ p.stdin.write(message.replace('@', '@@').encode('utf-8', 'replace'))
p.stdin.close()
p.wait()