2015-12-29 11:30:14 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2019-07-27 17:09:34 +00:00
|
|
|
import os, glob, subprocess
|
2015-12-29 11:30:14 +02:00
|
|
|
|
2017-04-26 13:10:13 +00:00
|
|
|
components = ('core', 'dbus', 'declarative', 'gui', 'network', 'plugins',
|
|
|
|
'script', 'scripttools', 'sql', 'svg', 'test', 'uitools', 'xml')
|
2015-12-29 11:30:14 +02:00
|
|
|
cfiles = []
|
|
|
|
tfiles = []
|
|
|
|
|
|
|
|
def list_files(sdir):
|
2016-01-09 12:55:18 +02:00
|
|
|
lfiles = []
|
2015-12-29 11:30:14 +02:00
|
|
|
for root, subdirs, files in os.walk(sdir):
|
|
|
|
for sfile in files:
|
2016-01-12 23:09:40 +02:00
|
|
|
if sfile.endswith(('.cpp', '.h', '.js', '.qs', '.qml', '.ui')):
|
2016-01-09 12:55:18 +02:00
|
|
|
lfiles.append('%s/%s' % (root, sfile))
|
|
|
|
return lfiles
|
2015-12-29 11:30:14 +02:00
|
|
|
|
|
|
|
for c in components:
|
2016-01-11 17:42:52 +02:00
|
|
|
cfiles.extend(list_files('src/%s' % c))
|
2015-12-29 11:30:14 +02:00
|
|
|
|
2016-10-25 02:47:12 +00:00
|
|
|
for t in glob.glob('src/tools/*'):
|
|
|
|
tfiles.extend(list_files(t))
|
2015-12-29 11:30:14 +02:00
|
|
|
|
|
|
|
for t in glob.glob('translations/qt*.ts'):
|
2019-07-27 17:09:34 +00:00
|
|
|
command = ['minsize/bin/lupdate', '-locations', 'relative', '-no-ui-lines', '-no-obsolete']
|
|
|
|
if not 'tools' in t:
|
|
|
|
command.extend(cfiles)
|
2019-07-27 22:06:00 +00:00
|
|
|
else:
|
|
|
|
command.extend(tfiles)
|
2019-07-27 17:09:34 +00:00
|
|
|
command.extend(['-ts', t])
|
|
|
|
subprocess.check_call(command)
|