review updatetranslations script

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-07-27 17:09:34 +00:00
parent 0c28c71e12
commit fba22ee92c

View file

@ -1,6 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
import os, glob, subprocess, shlex import os, glob, subprocess
components = ('core', 'dbus', 'declarative', 'gui', 'network', 'plugins', components = ('core', 'dbus', 'declarative', 'gui', 'network', 'plugins',
'script', 'scripttools', 'sql', 'svg', 'test', 'uitools', 'xml') 'script', 'scripttools', 'sql', 'svg', 'test', 'uitools', 'xml')
@ -22,13 +22,10 @@ for t in glob.glob('src/tools/*'):
tfiles.extend(list_files(t)) tfiles.extend(list_files(t))
for t in glob.glob('translations/qt*.ts'): for t in glob.glob('translations/qt*.ts'):
if 'tools' in t: command = ['minsize/bin/lupdate', '-locations', 'relative', '-no-ui-lines', '-no-obsolete']
files = ' '.join(tfiles) if not 'tools' in t:
command.extend(tfiles)
else: else:
files = ' '.join(cfiles) command.extend(cfiles)
command = 'minsize/bin/lupdate -locations relative -no-ui-lines -no-obsolete %s -ts %s' % (files, t) command.extend(['-ts', t])
command = shlex.split(command) subprocess.check_call(command)
pipe = subprocess.Popen(command, stderr=subprocess.PIPE)
pipe.wait()
if pipe.returncode != 0:
raise(Exception(pipe.communicate()[1].strip()))