Some work about adaptive color scheme for Web UI (PR #19901) http://[316:c51a:62a3:8b9::4]/d4708/qBittorrent/src/branch/adaptive-webui
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.6 KiB

#!/usr/bin/env python
# Small script to update qrc files (lang.qrc, icons.qrc)
# by Christophe Dumez <chris@qbittorrent.org>
import os
from os.path import splitext, join
# update languages files directory
languages_list = [x for x in os.listdir('lang') if x.endswith('.qm')]
output = '''<!DOCTYPE RCC><RCC version="1.0">
<qresource>
'''
for language in languages_list:
output += ' <file>%s</file>'%('lang'+os.sep+language)
output += os.linesep
output += '''</qresource>
</RCC>'''
lang_file = open('lang.qrc', 'w')
lang_file.write(output)
lang_file.close()
# update search_engine directory
search_list = []
for root, dirs, files in os.walk('search_engine'):
for file in files:
if file.startswith("__"):
continue
if splitext(file)[-1] in ('.py', '.png'):
search_list.append(join(root, file))
output = '''<!DOCTYPE RCC><RCC version="1.0">
<qresource>
'''
for file in search_list:
output += ' <file>%s</file>'%(file)
output += os.linesep
output += '''</qresource>
</RCC>'''
search_file = open('search.qrc', 'w')
search_file.write(output)
search_file.close()
# update icons files directory
icons_list = []
for root, dirs, files in os.walk('Icons'):
if 'skin_unused' in dirs:
dirs.remove('skin_unused')
for file in files:
if splitext(file)[-1] in ('.png', '.jpg'):
icons_list.append(join(root, file))
output = '''<!DOCTYPE RCC><RCC version="1.0">
<qresource>
'''
for icon in icons_list:
output += ' <file>%s</file>'%(icon)
output += os.linesep
output += '''</qresource>
</RCC>'''
icons_file = open('icons.qrc', 'w')
icons_file.write(output)
icons_file.close()