summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-11-10 05:19:34 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-11-10 05:19:34 +0100
commiteaf67dc569583adbfd83bd9f0ec3a5eeb2737d84 (patch)
tree39bffdf22ef04c3c6fda4ce735296361cfd289f9 /plugins
parente467020e29aae638d018b8a793b1816f7a65c893 (diff)
downloadpoezio-eaf67dc569583adbfd83bd9f0ec3a5eeb2737d84.tar.gz
poezio-eaf67dc569583adbfd83bd9f0ec3a5eeb2737d84.tar.bz2
poezio-eaf67dc569583adbfd83bd9f0ec3a5eeb2737d84.tar.xz
poezio-eaf67dc569583adbfd83bd9f0ec3a5eeb2737d84.zip
Exec plugin now executes the command in sh -c, allowing us to do some shell tricks etc (pipes, for example).
Diffstat (limited to 'plugins')
-rw-r--r--plugins/exec.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/plugins/exec.py b/plugins/exec.py
index f7f451df..c729b555 100644
--- a/plugins/exec.py
+++ b/plugins/exec.py
@@ -22,12 +22,7 @@ class Plugin(BasePlugin):
self.core.command_help('exec')
return
try:
- cut_command = shlex.split(command)
- except Exception as e:
- self.core.information('Failed to parse command: %s' % (e,), 'Error')
- return
- try:
- process = subprocess.Popen(cut_command, stdout=subprocess.PIPE)
+ process = subprocess.Popen(['sh', '-c', command], stdout=subprocess.PIPE)
except OSError as e:
self.core.information('Failed to execute command: %s' % (e,), 'Error')
return