ED_LRR/build_gui.py

19 lines
609 B
Python
Raw Permalink Normal View History

2020-03-28 13:53:52 +00:00
# -*- coding: utf-8 -*-
2020-02-05 23:24:24 +00:00
from PyQt5 import uic
2019-07-14 22:43:57 +00:00
import os
ui_path = os.path.dirname(os.path.abspath(__file__))
for root, folders, files in os.walk(ui_path):
2020-03-28 13:53:52 +00:00
if "site-packages" in root:
continue
if ".history" in folders:
folders.remove(".history")
2019-07-14 22:43:57 +00:00
for file in files:
file = os.path.join(root, file)
outfile, ext = os.path.splitext(file)
if ext == ".ui":
outfile = outfile + ".py"
print(file, "->", outfile)
2020-02-05 23:24:24 +00:00
with open(outfile, "w") as fh_out:
uic.compileUi(file, fh_out, from_imports=True)