aboutsummaryrefslogtreecommitdiff
path: root/music_sampler/actions/run_command.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-27 21:33:09 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-27 21:33:09 +0200
commit63ba5a8dc2aa4ec3e6f203b0ba4db249ecf0b00e (patch)
treef043ab215425aca3434bf178029dad9f9e62dbe9 /music_sampler/actions/run_command.py
parent35bde798b6cda13579337b0ec5a803fdd5eab19a (diff)
downloadMusicSampler-63ba5a8dc2aa4ec3e6f203b0ba4db249ecf0b00e.tar.gz
MusicSampler-63ba5a8dc2aa4ec3e6f203b0ba4db249ecf0b00e.tar.zst
MusicSampler-63ba5a8dc2aa4ec3e6f203b0ba4db249ecf0b00e.zip
Rename helpers to music_sampler
Diffstat (limited to 'music_sampler/actions/run_command.py')
-rw-r--r--music_sampler/actions/run_command.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/music_sampler/actions/run_command.py b/music_sampler/actions/run_command.py
new file mode 100644
index 0000000..1e80c1e
--- /dev/null
+++ b/music_sampler/actions/run_command.py
@@ -0,0 +1,13 @@
1import shlex, subprocess
2
3def run(action, command="", wait=False, **kwargs):
4 action.process = subprocess.Popen(command, shell=True)
5 if wait:
6 action.process.wait()
7
8def description(action, command="", wait=False, **kwargs):
9 message = "running command {}".format(command)
10 if wait:
11 message += " (waiting for its execution to finish)"
12
13 return message