Skip to content

Commit 6e77db1

Browse files
authored
Merge pull request #27 from Intergration-Automation-Testing/dev
Refactor and update
2 parents 038d054 + b6012c6 commit 6e77db1

File tree

5 files changed

+121
-30
lines changed

5 files changed

+121
-30
lines changed

auto_py_to_exe.json

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"version": "auto-py-to-exe-configuration_v1",
3+
"pyinstallerOptions": [
4+
{
5+
"optionDest": "noconfirm",
6+
"value": true
7+
},
8+
{
9+
"optionDest": "filenames",
10+
"value": "C:/Users/JeffreyChen/Desktop/Code_Space/AutomationEditor/exe/start_automation_editor.py"
11+
},
12+
{
13+
"optionDest": "onefile",
14+
"value": false
15+
},
16+
{
17+
"optionDest": "console",
18+
"value": false
19+
},
20+
{
21+
"optionDest": "icon_file",
22+
"value": "C:/Users/JeffreyChen/Desktop/Code_Space/AutomationEditor/exe/je_driver_icon.ico"
23+
},
24+
{
25+
"optionDest": "name",
26+
"value": "AutomationEditor"
27+
},
28+
{
29+
"optionDest": "ascii",
30+
"value": false
31+
},
32+
{
33+
"optionDest": "clean_build",
34+
"value": false
35+
},
36+
{
37+
"optionDest": "strip",
38+
"value": false
39+
},
40+
{
41+
"optionDest": "noupx",
42+
"value": false
43+
},
44+
{
45+
"optionDest": "disable_windowed_traceback",
46+
"value": false
47+
},
48+
{
49+
"optionDest": "embed_manifest",
50+
"value": true
51+
},
52+
{
53+
"optionDest": "uac_admin",
54+
"value": false
55+
},
56+
{
57+
"optionDest": "uac_uiaccess",
58+
"value": false
59+
},
60+
{
61+
"optionDest": "win_private_assemblies",
62+
"value": false
63+
},
64+
{
65+
"optionDest": "win_no_prefer_redirects",
66+
"value": false
67+
},
68+
{
69+
"optionDest": "bootloader_ignore_signals",
70+
"value": false
71+
},
72+
{
73+
"optionDest": "argv_emulation",
74+
"value": false
75+
},
76+
{
77+
"optionDest": "datas",
78+
"value": "C:/Users/JeffreyChen/Desktop/Code_Space/AutomationEditor/exe/je_driver_icon.ico;."
79+
},
80+
{
81+
"optionDest": "pathex",
82+
"value": "C:/Users/JeffreyChen/Desktop/Code_Space/AutomationEditor/venv"
83+
}
84+
],
85+
"nonPyinstallerOptions": {
86+
"increaseRecursionLimit": true,
87+
"manualArguments": ""
88+
}
89+
}

automation_editor/automation_editor_ui/editor_main/main_ui.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22

33
from PySide6.QtWidgets import QApplication
4-
from je_editor import EditorMain, shell_manager
4+
from je_editor import EditorMain, ShellManager
55
from qt_material import apply_stylesheet
66

77
from automation_editor.automation_editor_ui. \
@@ -29,8 +29,6 @@ def __init__(self):
2929
set_web_runner_menu(self)
3030
set_install_menu(self)
3131
syntax_extend_package(self)
32-
shell_manager.main_window = self
33-
shell_manager.later_init()
3432
self.setWindowTitle("Automation Editor")
3533

3634

automation_editor/automation_editor_ui/menu/install_menu/build_install_menu.py

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,43 @@
55

66
from PySide6.QtGui import QAction
77
from PySide6.QtWidgets import QMainWindow
8-
from je_editor import shell_manager
9-
8+
from je_editor import ShellManager
109

1110
def set_install_menu(ui_we_want_to_set: QMainWindow):
1211
ui_we_want_to_set.install_menu = ui_we_want_to_set.menu.addMenu("Install")
1312
# Try to install Build Tools
1413
ui_we_want_to_set.install_tool_action = QAction("Install Build Tools")
1514
ui_we_want_to_set.install_tool_action.triggered.connect(
16-
install_build_tools
15+
lambda: install_build_tools(ui_we_want_to_set)
1716
)
1817
ui_we_want_to_set.install_menu.addAction(ui_we_want_to_set.install_tool_action)
1918
# Try to install AutoControl
2019
ui_we_want_to_set.install_autocontrol_action = QAction("Install AutoControl")
2120
ui_we_want_to_set.install_autocontrol_action.triggered.connect(
22-
install_autocontrol
21+
lambda: install_autocontrol(ui_we_want_to_set)
2322
)
2423
ui_we_want_to_set.install_menu.addAction(ui_we_want_to_set.install_autocontrol_action)
2524
# Try to install APITestka
2625
ui_we_want_to_set.install_api_testka = QAction("Install APITestka")
2726
ui_we_want_to_set.install_api_testka.triggered.connect(
28-
install_api_testka
27+
lambda: install_api_testka(ui_we_want_to_set)
2928
)
3029
ui_we_want_to_set.install_menu.addAction(ui_we_want_to_set.install_api_testka)
3130
# Try to install LoadDensity
3231
ui_we_want_to_set.install_load_density_action = QAction("Install LoadDensity")
3332
ui_we_want_to_set.install_load_density_action.triggered.connect(
34-
install_load_density
33+
lambda: install_load_density(ui_we_want_to_set)
3534
)
3635
ui_we_want_to_set.install_menu.addAction(ui_we_want_to_set.install_load_density_action)
3736
# Try to install WebRunner
3837
ui_we_want_to_set.install_web_runner_action = QAction("Install WebRunner")
3938
ui_we_want_to_set.install_web_runner_action.triggered.connect(
40-
install_web_runner
39+
lambda: install_web_runner(ui_we_want_to_set)
4140
)
4241
ui_we_want_to_set.install_menu.addAction(ui_we_want_to_set.install_web_runner_action)
4342

4443

45-
def install_package(package_text: str):
44+
def install_package(package_text: str, ui_we_want_to_set: QMainWindow):
4645
if sys.platform in ["win32", "cygwin", "msys"]:
4746
venv_path = Path(os.getcwd() + "/venv/Scripts")
4847
else:
@@ -61,24 +60,29 @@ def install_package(package_text: str):
6160
)
6261
else:
6362
compiler_path = shutil.which(cmd="python")
64-
shell_manager.exec_shell(f"{compiler_path} -m pip install {package_text}")
63+
shell_manager = ShellManager()
64+
shell_manager.main_window = ui_we_want_to_set
65+
shell_manager.later_init()
66+
shell_manager.exec_shell([f"{compiler_path}", "-m", "pip", "install", f"{package_text}"])
6567

6668

67-
def install_build_tools():
68-
install_package("setuptools build wheel")
69+
def install_build_tools(ui_we_want_to_set: QMainWindow):
70+
install_package("setuptools", ui_we_want_to_set)
71+
install_package("build", ui_we_want_to_set)
72+
install_package("wheel", ui_we_want_to_set)
6973

7074

71-
def install_autocontrol():
72-
install_package("je_auto_control")
75+
def install_autocontrol(ui_we_want_to_set: QMainWindow):
76+
install_package("je_auto_control", ui_we_want_to_set)
7377

7478

75-
def install_api_testka():
76-
install_package("je_api_testka")
79+
def install_api_testka(ui_we_want_to_set: QMainWindow):
80+
install_package("je_api_testka", ui_we_want_to_set)
7781

7882

79-
def install_load_density():
80-
install_package("je_load_density")
83+
def install_load_density(ui_we_want_to_set: QMainWindow):
84+
install_package("je_load_density", ui_we_want_to_set)
8185

8286

83-
def install_web_runner():
84-
install_package("je_web_runner")
87+
def install_web_runner(ui_we_want_to_set: QMainWindow):
88+
install_package("je_web_runner", ui_we_want_to_set)

stable.toml renamed to dev.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Rename to build stable version
2-
# This is stable version
1+
# Rename to dev version
2+
# This is dev version
33
[build-system]
44
requires = ["setuptools>=61.0"]
55
build-backend = "setuptools.build_meta"
66

77
[project]
8-
name = "automation_editor"
9-
version = "0.0.6"
8+
name = "automation_editor_dev"
9+
version = "0.0.7"
1010
authors = [
1111
{ name = "JE-Chen", email = "[email protected]" },
1212
]

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Rename to dev version
2-
# This is dev version
1+
# Rename to build stable version
2+
# This is stable version
33
[build-system]
44
requires = ["setuptools>=61.0"]
55
build-backend = "setuptools.build_meta"
66

77
[project]
8-
name = "automation_editor_dev"
9-
version = "0.0.6"
8+
name = "automation_editor"
9+
version = "0.0.7"
1010
authors = [
1111
{ name = "JE-Chen", email = "[email protected]" },
1212
]

0 commit comments

Comments
 (0)