]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blame - music_sampler/actions/run_command.py
Make music_sampler multilingual
[perso/Immae/Projets/Python/MusicSampler.git] / music_sampler / actions / run_command.py
CommitLineData
df9ddd34
IB
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):
6a327173
IB
9 formats = []
10 message = "running command {}"
11 formats.append(command)
df9ddd34
IB
12 if wait:
13 message += " (waiting for its execution to finish)"
14
6a327173 15 return _(message).format(*formats)