From fba22ee92c789087ea6e2cd68a8a2147c729bc43 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 27 Jul 2019 17:09:34 +0000 Subject: [PATCH] review updatetranslations script Signed-off-by: Ivailo Monev --- scripts/updatetranslations.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/updatetranslations.py b/scripts/updatetranslations.py index 7c3f67c46..9182773ce 100755 --- a/scripts/updatetranslations.py +++ b/scripts/updatetranslations.py @@ -1,6 +1,6 @@ #!/usr/bin/python -import os, glob, subprocess, shlex +import os, glob, subprocess components = ('core', 'dbus', 'declarative', 'gui', 'network', 'plugins', 'script', 'scripttools', 'sql', 'svg', 'test', 'uitools', 'xml') @@ -22,13 +22,10 @@ for t in glob.glob('src/tools/*'): tfiles.extend(list_files(t)) for t in glob.glob('translations/qt*.ts'): - if 'tools' in t: - files = ' '.join(tfiles) + command = ['minsize/bin/lupdate', '-locations', 'relative', '-no-ui-lines', '-no-obsolete'] + if not 'tools' in t: + command.extend(tfiles) else: - files = ' '.join(cfiles) - command = 'minsize/bin/lupdate -locations relative -no-ui-lines -no-obsolete %s -ts %s' % (files, t) - command = shlex.split(command) - pipe = subprocess.Popen(command, stderr=subprocess.PIPE) - pipe.wait() - if pipe.returncode != 0: - raise(Exception(pipe.communicate()[1].strip())) + command.extend(cfiles) + command.extend(['-ts', t]) + subprocess.check_call(command) -- 2.11.0