#!/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')
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)