UpdateResourceFile.py 508 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/env python
import os

def main():
    qrcFile = open("InstrumentValueIcons.qrc", 'wt')

    qrcFile.write("<RCC>\n")
    qrcFile.write("\t<qresource prefix=\"/InstrumentValueIcons\">\n")

    files = os.listdir(".")
    for filename in files:
        if filename.endswith(".svg"):
13
            qrcFile.write("\t\t<file alias=\"%s\">%s</file>\n" % (filename, filename))
14 15 16 17 18 19 20 21

    qrcFile.write("\t</qresource>\n")
    qrcFile.write("</RCC>\n")

    qrcFile.close()

if __name__ == '__main__':
    main()