-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_qrc.py
33 lines (25 loc) · 1020 Bytes
/
build_qrc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# gPodder Windows Build Script
# 2014-02-22 Thomas Perl <thp.io/about>
# All rights reserved.
import os
IGNORED_FILES = ['common']
# Can be touch or desktop at the moment
variant = 'touch'
def mount_files(out, source, target):
for path, dirnames, filenames in os.walk(source):
path = path.replace('\\', '/')
for filename in sorted(filenames):
if filename in IGNORED_FILES:
continue
from_filename = '/'.join((path, filename))
to_filename = from_filename.replace(source, target)
print('<file alias="%s">%s</file>' % (to_filename, from_filename), file=out)
print(from_filename, '->', to_filename)
with open('gpodder.qrc', 'w') as out:
print('<RCC>', file=out)
print('<qresource prefix="/">', file=out)
# QML UI
mount_files(out, 'gpodder-ui-qml/%s' % variant, variant)
mount_files(out, 'gpodder-ui-qml/common', '%s/common' % variant)
print('</qresource>', file=out)
print('</RCC>', file=out)