from jmwright 72b67da

This commit is contained in:
jdegenstein
2022-09-16 13:52:44 -05:00
committed by GitHub
parent 04978a6f78
commit fffb6db0f2
50 changed files with 14900 additions and 0 deletions

30
collect_icons.py Normal file
View File

@@ -0,0 +1,30 @@
from glob import glob
from subprocess import call
from os import remove
TEMPLATE = \
'''<RCC>
<qresource prefix="/images">
{}
</qresource>
</RCC>'''
ITEM_TEMPLATE = '<file>{}</file>'
QRC_OUT = 'icons.qrc'
RES_OUT = 'src/icons_res.py'
TOOL = 'pyrcc5'
items = []
for i in glob('icons/*.svg'):
items.append(ITEM_TEMPLATE.format(i))
qrc_text = TEMPLATE.format('\n'.join(items))
with open(QRC_OUT,'w') as f:
f.write(qrc_text)
call([TOOL,QRC_OUT,'-o',RES_OUT])
remove(QRC_OUT)