Skip to content

Commit c28b826

Browse files
committed
Add OS specific setup build script paths and copy logic to startup wrapper
1 parent 7871f2b commit c28b826

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

automations/const.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,26 @@ def invalid_platform() -> int:
6767
OS_SPECIFIC_DIR = pathlib.Path(
6868
PROJECT_ROOT_DIR / "os_specific/windows"
6969
)
70+
OS_SPECIFIC_SETUP_BUILD_EXE = pathlib.Path(
71+
OS_SPECIFIC_DIR, "setup_build_exe.py"
72+
)
7073
elif __APPLE__:
7174
PYMOL_PACKAGE_DIR = pathlib.Path(
7275
PROJECT_ROOT_DIR / f".venv/lib/python{PYTHON_VERSION}/site-packages/pymol"
7376
)
7477
OS_SPECIFIC_DIR = pathlib.Path(
7578
PROJECT_ROOT_DIR / "os_specific/macos"
7679
)
80+
OS_SPECIFIC_SETUP_BUILD_EXE = pathlib.Path(
81+
OS_SPECIFIC_DIR, "setup_build_exe.py"
82+
)
7783
elif __linux__:
7884
PYMOL_PACKAGE_DIR = pathlib.Path(
7985
PROJECT_ROOT_DIR / f".venv/lib/python{PYTHON_VERSION}/site-packages/pymol"
8086
)
8187
OS_SPECIFIC_DIR = pathlib.Path(
8288
PROJECT_ROOT_DIR / "os_specific/linux"
8389
)
90+
OS_SPECIFIC_SETUP_BUILD_EXE = pathlib.Path(
91+
OS_SPECIFIC_DIR, "setup_build_exe.py"
92+
)

edited/pymol/startup_wrapper.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,31 @@
33

44

55
if __name__ == '__main__':
6-
pymol.launch(*sys.argv[1:])
6+
pymol.launch(sys.argv)
7+
8+
# Coping startup_wrapper and OS specific build scripts into the application package
9+
# <editor-fold desc="Definitions">
10+
# startup_wrapper script
11+
tmp_edited_startup_wrapper_py_filepath = pathlib.Path(
12+
const.PROJECT_ROOT_DIR / "edited/pymol", "startup_wrapper.py"
13+
)
14+
15+
# OS specific build script
16+
tmp_os_specific_build_exe_filepath = pathlib.Path(
17+
const.OS_SPECIFIC_SETUP_BUILD_EXE
18+
)
19+
# </editor-fold>
20+
21+
# <editor-fold desc="Copy">
22+
# startup_wrapper script
23+
shutil.copy(
24+
tmp_edited_startup_wrapper_py_filepath,
25+
pathlib.Path(const.PYMOL_PACKAGE_DIR / "startup_wrapper.py")
26+
)
27+
28+
# OS specific build script
29+
shutil.copy(
30+
tmp_os_specific_build_exe_filepath,
31+
pathlib.Path(const.PYMOL_PACKAGE_DIR / "setup_build_exe.py")
32+
)
33+
# </editor-fold>

0 commit comments

Comments
 (0)