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
|
2019-09-28 17:31:44 +00:00
|
|
|
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"
|
2019-10-23 09:36:45 +00:00
|
|
|
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)
|