Bread_Editor/gui/raw_ui/ui_to_py.py

23 lines
563 B
Python

#!/usr/bin/python3
import os
working_dir = os.getcwd()
if not working_dir.split('/')[-1] == "raw_ui": # cd into the right directory if this gets executed from somewhere else
os.chdir(os.path.dirname(os.path.abspath(__file__)))
input_debug = input("Do you want to debug the gui scripts? (Make gui scripts executable.) (y/n): ")
debug = input_debug == "y"
params = "-o"
if debug:
params = "-xo"
paths = {
"main_window.ui": "main_window.py"
}
for ui_file, script_out in paths.items():
os.system(f"pyuic6 {ui_file} {params} ../{script_out}")