]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blob - music_sampler/actions/run_command.py
1e80c1eeb31f2dc6ae41b00192c879abdb36465e
[perso/Immae/Projets/Python/MusicSampler.git] / music_sampler / actions / run_command.py
1 import shlex, subprocess
2
3 def run(action, command="", wait=False, **kwargs):
4 action.process = subprocess.Popen(command, shell=True)
5 if wait:
6 action.process.wait()
7
8 def 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