From: Anders Kaseorg Date: Tue, 30 Jun 2009 20:24:59 +0000 (-0400) Subject: TracZephyrPlugin: Split command using shlex to allow multiword arguments. X-Git-Url: https://snippets.scripts.mit.edu/gitweb.cgi/Scripts/git/.git/commitdiff_plain/1246b147f7544c069fb3fb1b8e9b9d22b3eeb71c TracZephyrPlugin: Split command using shlex to allow multiword arguments. Signed-off-by: Anders Kaseorg --- diff --git a/TracZephyrPlugin/ZephyrPlugin.py b/TracZephyrPlugin/ZephyrPlugin.py index f011a8b..5546bda 100644 --- a/TracZephyrPlugin/ZephyrPlugin.py +++ b/TracZephyrPlugin/ZephyrPlugin.py @@ -2,6 +2,7 @@ from trac.core import * from trac.ticket import ITicketChangeListener import subprocess import textwrap +import shlex class ZephyrPlugin(Component): implements(ITicketChangeListener) @@ -10,7 +11,7 @@ class ZephyrPlugin(Component): 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 +