setup.py now automatically executes the gui generation script.
This commit is contained in:
parent
ea8b7456cc
commit
47ede1e689
3 changed files with 18 additions and 8 deletions
|
@ -1,3 +1 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from bread_editor.main import start_from_command_line
|
|
||||||
|
|
|
@ -7,9 +7,13 @@ working_dir = os.getcwd()
|
||||||
if not working_dir.split('/')[-1] == "raw_ui": # cd into the right directory if this gets executed from somewhere else
|
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__)))
|
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): ")
|
if __name__ == "__main__": # dont ask for debug on setup
|
||||||
|
input_debug = input("Do you want to debug the gui scripts? (Make gui scripts executable.) (y/n): ")
|
||||||
|
|
||||||
debug = input_debug == "y"
|
debug = input_debug == "y"
|
||||||
|
|
||||||
|
else:
|
||||||
|
debug = False
|
||||||
|
|
||||||
params = "-o"
|
params = "-o"
|
||||||
if debug:
|
if debug:
|
||||||
|
@ -19,5 +23,10 @@ paths = {
|
||||||
"main_window.ui": "main_window.py"
|
"main_window.ui": "main_window.py"
|
||||||
}
|
}
|
||||||
|
|
||||||
for ui_file, script_out in paths.items():
|
|
||||||
os.system(f"pyuic6 {ui_file} {params} ../{script_out}")
|
def convert_ui():
|
||||||
|
for ui_file, script_out in paths.items():
|
||||||
|
os.system(f"pyuic6 {ui_file} {params} ../{script_out}")
|
||||||
|
|
||||||
|
|
||||||
|
os.chdir(working_dir) # switch back to the working directory from which the script was executed
|
||||||
|
|
7
setup.py
7
setup.py
|
@ -1,8 +1,11 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import setuptools
|
import setuptools
|
||||||
|
from bread_editor.gui.raw_ui import ui_to_py
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
ui_to_py.convert_ui() # convert the .ui files to .py files before setup
|
||||||
|
|
||||||
this_directory = Path(__file__).parent # use readme file as long description
|
this_directory = Path(__file__).parent # use readme file as long description
|
||||||
long_description = (this_directory / "README.md").read_text()
|
long_description = (this_directory / "README.md").read_text()
|
||||||
|
|
||||||
|
@ -15,13 +18,13 @@ setuptools.setup(
|
||||||
url="https://teapot.informationsanarchistik.de/Wobbl/Bread_Editor",
|
url="https://teapot.informationsanarchistik.de/Wobbl/Bread_Editor",
|
||||||
author="The Wobbler",
|
author="The Wobbler",
|
||||||
author_email="emil@i21k.de",
|
author_email="emil@i21k.de",
|
||||||
packages=["bread_editor"],
|
packages=["bread_editor", "bread_editor.gui"],
|
||||||
package_data={"": ["*.ui", "*.txt"]},
|
package_data={"": ["*.ui", "*.txt"]},
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"PyQt6",
|
"PyQt6",
|
||||||
"wobbl_tools @ git+https://teapot.informationsanarchistik.de/Wobbl/wobbl_tools@main#egg=wobbl_tools"
|
"wobbl_tools @ git+https://teapot.informationsanarchistik.de/Wobbl/wobbl_tools@main#egg=wobbl_tools"
|
||||||
],
|
],
|
||||||
entry_points={
|
entry_points={
|
||||||
"console_scripts": ["bread_editor=bread_editor:start_from_command_line"],
|
"console_scripts": ["bread_editor=bread_editor.main:start_from_command_line"],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue