PyBreeze 1.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. automation_ide/__init__.py +7 -0
  2. automation_ide/__main__.py +0 -0
  3. automation_ide/automation_editor_ui/__init__.py +0 -0
  4. automation_ide/automation_editor_ui/connect_gui/__init__.py +0 -0
  5. automation_ide/automation_editor_ui/connect_gui/ssh/__init__.py +0 -0
  6. automation_ide/automation_editor_ui/connect_gui/ssh/ssh_command_widget.py +246 -0
  7. automation_ide/automation_editor_ui/connect_gui/ssh/ssh_file_viewer_widget.py +501 -0
  8. automation_ide/automation_editor_ui/connect_gui/ssh/ssh_login_widget.py +67 -0
  9. automation_ide/automation_editor_ui/connect_gui/ssh/ssh_main_widget.py +49 -0
  10. automation_ide/automation_editor_ui/connect_gui/url/__init__.py +0 -0
  11. automation_ide/automation_editor_ui/connect_gui/url/ai_code_review_gui.py +177 -0
  12. automation_ide/automation_editor_ui/editor_main/__init__.py +0 -0
  13. automation_ide/automation_editor_ui/editor_main/main_ui.py +104 -0
  14. automation_ide/automation_editor_ui/extend_ai_gui/__init__.py +0 -0
  15. automation_ide/automation_editor_ui/extend_ai_gui/ai_gui_global_variable.py +40 -0
  16. automation_ide/automation_editor_ui/extend_ai_gui/code_review/__init__.py +0 -0
  17. automation_ide/automation_editor_ui/extend_ai_gui/code_review/code_review_thread.py +81 -0
  18. automation_ide/automation_editor_ui/extend_ai_gui/code_review/cot_code_review_gui.py +82 -0
  19. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/__init__.py +0 -0
  20. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_code_review_prompt_templates/__init__.py +0 -0
  21. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_code_review_prompt_templates/code_smell_detector.py +22 -0
  22. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_code_review_prompt_templates/first_code_review.py +17 -0
  23. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_code_review_prompt_templates/first_summary_prompt.py +17 -0
  24. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_code_review_prompt_templates/global_rule.py +59 -0
  25. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_code_review_prompt_templates/judge.py +91 -0
  26. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_code_review_prompt_templates/judge_single_review.py +85 -0
  27. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_code_review_prompt_templates/linter.py +17 -0
  28. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_code_review_prompt_templates/step_by_step_analysis.py +35 -0
  29. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_code_review_prompt_templates/total_summary.py +66 -0
  30. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/cot_prompt_editor_widget.py +136 -0
  31. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/skills_prompt_editor_widget.py +136 -0
  32. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/skills_prompt_templates/__init__.py +0 -0
  33. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/skills_prompt_templates/code_explainer.py +21 -0
  34. automation_ide/automation_editor_ui/extend_ai_gui/prompt_edit_gui/skills_prompt_templates/code_review.py +37 -0
  35. automation_ide/automation_editor_ui/extend_ai_gui/skills/__init__.py +0 -0
  36. automation_ide/automation_editor_ui/extend_ai_gui/skills/skills_send_gui.py +98 -0
  37. automation_ide/automation_editor_ui/extend_multi_language/__init__.py +0 -0
  38. automation_ide/automation_editor_ui/extend_multi_language/extend_english.py +272 -0
  39. automation_ide/automation_editor_ui/extend_multi_language/extend_traditional_chinese.py +272 -0
  40. automation_ide/automation_editor_ui/extend_multi_language/update_language_dict.py +8 -0
  41. automation_ide/automation_editor_ui/menu/__init__.py +0 -0
  42. automation_ide/automation_editor_ui/menu/automation_menu/__init__.py +0 -0
  43. automation_ide/automation_editor_ui/menu/automation_menu/api_testka_menu/__init__.py +0 -0
  44. automation_ide/automation_editor_ui/menu/automation_menu/api_testka_menu/build_api_testka_menu.py +137 -0
  45. automation_ide/automation_editor_ui/menu/automation_menu/auto_control_menu/__init__.py +0 -0
  46. automation_ide/automation_editor_ui/menu/automation_menu/auto_control_menu/build_autocontrol_menu.py +169 -0
  47. automation_ide/automation_editor_ui/menu/automation_menu/automation_file_menu/__init__.py +0 -0
  48. automation_ide/automation_editor_ui/menu/automation_menu/automation_file_menu/build_automation_file_menu.py +122 -0
  49. automation_ide/automation_editor_ui/menu/automation_menu/load_density_menu/__init__.py +0 -0
  50. automation_ide/automation_editor_ui/menu/automation_menu/load_density_menu/build_load_density_menu.py +137 -0
  51. automation_ide/automation_editor_ui/menu/automation_menu/mail_thunder_menu/__init__.py +0 -0
  52. automation_ide/automation_editor_ui/menu/automation_menu/mail_thunder_menu/build_mail_thunder_menu.py +88 -0
  53. automation_ide/automation_editor_ui/menu/automation_menu/test_pioneer_menu/__init__.py +0 -0
  54. automation_ide/automation_editor_ui/menu/automation_menu/test_pioneer_menu/build_test_pioneer_menu.py +62 -0
  55. automation_ide/automation_editor_ui/menu/automation_menu/web_runner_menu/__init__.py +0 -0
  56. automation_ide/automation_editor_ui/menu/automation_menu/web_runner_menu/build_webrunner_menu.py +119 -0
  57. automation_ide/automation_editor_ui/menu/build_menubar.py +47 -0
  58. automation_ide/automation_editor_ui/menu/install_menu/__init__.py +0 -0
  59. automation_ide/automation_editor_ui/menu/install_menu/automation_menu/__init__.py +0 -0
  60. automation_ide/automation_editor_ui/menu/install_menu/automation_menu/build_automation_install_menu.py +82 -0
  61. automation_ide/automation_editor_ui/menu/install_menu/install_utils.py +21 -0
  62. automation_ide/automation_editor_ui/menu/install_menu/tools_menu/__init__.py +0 -0
  63. automation_ide/automation_editor_ui/menu/install_menu/tools_menu/build_tool_install_menu.py +29 -0
  64. automation_ide/automation_editor_ui/menu/menu_utils.py +16 -0
  65. automation_ide/automation_editor_ui/menu/tools/__init__.py +0 -0
  66. automation_ide/automation_editor_ui/menu/tools/tools_menu.py +162 -0
  67. automation_ide/automation_editor_ui/show_code_window/__init__.py +0 -0
  68. automation_ide/automation_editor_ui/show_code_window/code_window.py +21 -0
  69. automation_ide/automation_editor_ui/syntax/__init__.py +0 -0
  70. automation_ide/automation_editor_ui/syntax/syntax_extend.py +40 -0
  71. automation_ide/automation_editor_ui/syntax/syntax_keyword.py +163 -0
  72. automation_ide/extend/__init__.py +0 -0
  73. automation_ide/extend/mail_thunder_extend/__init__.py +0 -0
  74. automation_ide/extend/mail_thunder_extend/mail_thunder_setting.py +36 -0
  75. automation_ide/extend/process_executor/__init__.py +0 -0
  76. automation_ide/extend/process_executor/api_testka/__init__.py +0 -0
  77. automation_ide/extend/process_executor/api_testka/api_testka_process.py +66 -0
  78. automation_ide/extend/process_executor/auto_control/__init__.py +0 -0
  79. automation_ide/extend/process_executor/auto_control/auto_control_process.py +62 -0
  80. automation_ide/extend/process_executor/file_automation/__init__.py +0 -0
  81. automation_ide/extend/process_executor/file_automation/file_automation_process.py +66 -0
  82. automation_ide/extend/process_executor/load_density/__init__.py +0 -0
  83. automation_ide/extend/process_executor/load_density/load_density_process.py +66 -0
  84. automation_ide/extend/process_executor/mail_thunder/__init__.py +0 -0
  85. automation_ide/extend/process_executor/mail_thunder/mail_thunder_process.py +16 -0
  86. automation_ide/extend/process_executor/process_executor_utils.py +72 -0
  87. automation_ide/extend/process_executor/python_task_process_manager.py +177 -0
  88. automation_ide/extend/process_executor/test_pioneer/__init__.py +0 -0
  89. automation_ide/extend/process_executor/test_pioneer/test_pioneer_process_manager.py +181 -0
  90. automation_ide/extend/process_executor/web_runner/__init__.py +0 -0
  91. automation_ide/extend/process_executor/web_runner/web_runner_process.py +66 -0
  92. automation_ide/utils/__init__.py +0 -0
  93. automation_ide/utils/exception/__init__.py +0 -0
  94. automation_ide/utils/exception/exception_tags.py +37 -0
  95. automation_ide/utils/exception/exceptions.py +50 -0
  96. automation_ide/utils/file_process/__init__.py +0 -0
  97. automation_ide/utils/file_process/get_dir_file_list.py +29 -0
  98. automation_ide/utils/json_format/__init__.py +1 -0
  99. automation_ide/utils/json_format/json_process.py +28 -0
  100. automation_ide/utils/logging/__init__.py +0 -0
  101. automation_ide/utils/logging/logger.py +50 -0
  102. automation_ide/utils/manager/__init__.py +0 -0
  103. automation_ide/utils/manager/package_manager/__init__.py +0 -0
  104. automation_ide/utils/manager/package_manager/package_manager_class.py +18 -0
  105. pybreeze-1.0.4.dist-info/METADATA +69 -0
  106. pybreeze-1.0.4.dist-info/RECORD +109 -0
  107. pybreeze-1.0.4.dist-info/WHEEL +5 -0
  108. pybreeze-1.0.4.dist-info/licenses/LICENSE +21 -0
  109. pybreeze-1.0.4.dist-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from je_editor import EditorWidget, ShellManager
6
+
7
+ if TYPE_CHECKING:
8
+ from automation_ide.automation_editor_ui.editor_main.main_ui import AutomationEditor
9
+
10
+
11
+ def install_package(package_text: str, ui_we_want_to_set: AutomationEditor) -> None:
12
+ widget = ui_we_want_to_set.tab_widget.currentWidget()
13
+ if isinstance(widget, EditorWidget):
14
+ widget.python_compiler = ui_we_want_to_set.python_compiler
15
+ shell_manager = ShellManager(main_window=widget)
16
+ shell_manager.later_init()
17
+ if widget.python_compiler is not None:
18
+ compiler_path = widget.python_compiler
19
+ else:
20
+ compiler_path = shell_manager.compiler_path
21
+ shell_manager.exec_shell([f"{compiler_path}", "-m", "pip", "install", f"{package_text}", "-U"])
@@ -0,0 +1,29 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from PySide6.QtGui import QAction
6
+ from je_editor import language_wrapper
7
+
8
+ from automation_ide.automation_editor_ui.menu.install_menu.install_utils import install_package
9
+
10
+ if TYPE_CHECKING:
11
+ from automation_ide.automation_editor_ui.editor_main.main_ui import AutomationEditor
12
+
13
+
14
+ def build_tool_install_menu(ui_we_want_to_set: AutomationEditor):
15
+ ui_we_want_to_set.install_tools_menu = ui_we_want_to_set.install_menu.addMenu(
16
+ language_wrapper.language_word_dict.get("install_menu_tools_install_menu_label"))
17
+ # Try to install Build Tools
18
+ ui_we_want_to_set.install_tool_action = QAction(
19
+ language_wrapper.language_word_dict.get("install_menu_tools_install_build_tools"))
20
+ ui_we_want_to_set.install_tool_action.triggered.connect(
21
+ lambda: install_build_tools(ui_we_want_to_set)
22
+ )
23
+ ui_we_want_to_set.install_tools_menu.addAction(ui_we_want_to_set.install_tool_action)
24
+
25
+
26
+ def install_build_tools(ui_we_want_to_set: AutomationEditor) -> None:
27
+ install_package("setuptools", ui_we_want_to_set)
28
+ install_package("build", ui_we_want_to_set)
29
+ install_package("wheel", ui_we_want_to_set)
@@ -0,0 +1,16 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from je_editor import MainBrowserWidget
6
+
7
+ if TYPE_CHECKING:
8
+ from automation_ide.automation_editor_ui.editor_main.main_ui import AutomationEditor
9
+
10
+
11
+ def open_web_browser(
12
+ automation_editor_instance: AutomationEditor, url: str, tab_name: str) -> None:
13
+ automation_editor_instance.tab_widget.addTab(
14
+ MainBrowserWidget(start_url=url),
15
+ f"{tab_name}{automation_editor_instance.tab_widget.count()}"
16
+ )
@@ -0,0 +1,162 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from PySide6.QtGui import QAction, Qt
6
+ from je_editor import language_wrapper
7
+ from je_editor.pyside_ui.main_ui.dock.destroy_dock import DestroyDock
8
+ from je_editor import jeditor_logger
9
+
10
+ from automation_ide.automation_editor_ui.connect_gui.ssh.ssh_main_widget import SSHMainWidget
11
+ from automation_ide.automation_editor_ui.connect_gui.url.ai_code_review_gui import AICodeReviewClient
12
+ from automation_ide.automation_editor_ui.extend_ai_gui.prompt_edit_gui.cot_prompt_editor_widget import CoTPromptEditor
13
+ from automation_ide.automation_editor_ui.extend_ai_gui.prompt_edit_gui.skills_prompt_editor_widget import \
14
+ SkillPromptEditor
15
+ from automation_ide.automation_editor_ui.extend_ai_gui.skills.skills_send_gui import SkillsSendGUI
16
+
17
+ if TYPE_CHECKING:
18
+ from automation_ide.automation_editor_ui.editor_main.main_ui import AutomationEditor
19
+
20
+
21
+ def build_tools_menu(ui_we_want_to_set: AutomationEditor):
22
+ # Menus
23
+ ui_we_want_to_set.tools_menu = ui_we_want_to_set.menu.addMenu(language_wrapper.language_word_dict.get(
24
+ "extend_tools_menu_tools_menu"
25
+ ))
26
+ ui_we_want_to_set.tools_ssh_menu = ui_we_want_to_set.tools_menu.addMenu(language_wrapper.language_word_dict.get(
27
+ "extend_tools_menu_tools_ssh_menu"
28
+ ))
29
+ ui_we_want_to_set.tools_ai_menu = ui_we_want_to_set.tools_menu.addMenu(language_wrapper.language_word_dict.get(
30
+ "extend_tools_menu_tools_ai_menu"
31
+ ))
32
+
33
+ ui_we_want_to_set.tools_ssh_client_tab_action = QAction(language_wrapper.language_word_dict.get(
34
+ "extend_tools_menu_ssh_client_tab_action"
35
+ ))
36
+ ui_we_want_to_set.tools_ssh_client_tab_action.triggered.connect(lambda: ui_we_want_to_set.tab_widget.addTab(
37
+ SSHMainWidget(), language_wrapper.language_word_dict.get("extend_tools_menu_ssh_client_tab_label")
38
+ ))
39
+ ui_we_want_to_set.tools_ssh_menu.addAction(ui_we_want_to_set.tools_ssh_client_tab_action)
40
+
41
+ ui_we_want_to_set.tools_ai_code_review_action = QAction(language_wrapper.language_word_dict.get(
42
+ "extend_tools_menu_ai_code_review_tab_action"
43
+ ))
44
+ ui_we_want_to_set.tools_ai_code_review_action.triggered.connect(lambda: ui_we_want_to_set.tab_widget.addTab(
45
+ AICodeReviewClient(), language_wrapper.language_word_dict.get(
46
+ "extend_tools_menu_ai_code_review_tab_label"
47
+ )
48
+ ))
49
+ ui_we_want_to_set.tools_ai_menu.addAction(ui_we_want_to_set.tools_ai_code_review_action)
50
+
51
+ ui_we_want_to_set.tools_ai_cot_prompt_editor_action = QAction(language_wrapper.language_word_dict.get(
52
+ "extend_tools_menu_cot_prompt_editor_tab_action"
53
+ ))
54
+ ui_we_want_to_set.tools_ai_cot_prompt_editor_action.triggered.connect(lambda: ui_we_want_to_set.tab_widget.addTab(
55
+ CoTPromptEditor(), language_wrapper.language_word_dict.get(
56
+ "extend_tools_menu_cot_prompt_editor_tab_label"
57
+ )
58
+ ))
59
+ ui_we_want_to_set.tools_ai_menu.addAction(ui_we_want_to_set.tools_ai_cot_prompt_editor_action)
60
+
61
+ ui_we_want_to_set.tools_ai_skill_prompt_editor_action = QAction(language_wrapper.language_word_dict.get(
62
+ "extend_tools_menu_skill_prompt_editor_tab_action"
63
+ ))
64
+ ui_we_want_to_set.tools_ai_skill_prompt_editor_action.triggered.connect(lambda: ui_we_want_to_set.tab_widget.addTab(
65
+ SkillPromptEditor(), language_wrapper.language_word_dict.get(
66
+ "extend_tools_menu_skill_prompt_editor_tab_label"
67
+ )
68
+ ))
69
+ ui_we_want_to_set.tools_ai_menu.addAction(ui_we_want_to_set.tools_ai_skill_prompt_editor_action)
70
+
71
+ ui_we_want_to_set.tools_ai_skill_send_action = QAction(language_wrapper.language_word_dict.get(
72
+ "extend_tools_menu_skill_prompt_send_tab_label"
73
+ ))
74
+ ui_we_want_to_set.tools_ai_skill_send_action.triggered.connect(lambda: ui_we_want_to_set.tab_widget.addTab(
75
+ SkillsSendGUI(), language_wrapper.language_word_dict.get(
76
+ "extend_tools_menu_skill_prompt_send_tab_label"
77
+ )
78
+ ))
79
+ ui_we_want_to_set.tools_ai_menu.addAction(ui_we_want_to_set.tools_ai_skill_send_action)
80
+
81
+
82
+ def extend_dock_menu(ui_we_want_to_set: AutomationEditor):
83
+ # Sub menu
84
+ ui_we_want_to_set.dock_ssh_menu = ui_we_want_to_set.dock_menu.addMenu(
85
+ language_wrapper.language_word_dict.get("extend_tools_menu_dock_ssh_menu")
86
+ )
87
+ ui_we_want_to_set.dock_ai_menu = ui_we_want_to_set.dock_menu.addMenu(
88
+ language_wrapper.language_word_dict.get("extend_tools_menu_dock_ai_menu")
89
+ )
90
+ # SSH
91
+ ui_we_want_to_set.tools_ssh_client_dock_action = QAction(
92
+ language_wrapper.language_word_dict.get("extend_tools_menu_ssh_client_dock_action")
93
+ )
94
+ ui_we_want_to_set.tools_ssh_client_dock_action.triggered.connect(
95
+ lambda: add_dock(ui_we_want_to_set, "SSH"))
96
+ ui_we_want_to_set.dock_ssh_menu.addAction(ui_we_want_to_set.tools_ssh_client_dock_action)
97
+
98
+ # AI
99
+ ui_we_want_to_set.tools_ai_code_review_dock_action = QAction(language_wrapper.language_word_dict.get(
100
+ "extend_tools_menu_ai_code_review_dock_action"
101
+ ))
102
+ ui_we_want_to_set.tools_ai_code_review_dock_action.triggered.connect(
103
+ lambda: add_dock(ui_we_want_to_set, "AICodeReview"))
104
+ ui_we_want_to_set.dock_ai_menu.addAction(ui_we_want_to_set.tools_ai_code_review_dock_action)
105
+
106
+ ui_we_want_to_set.tools_cot_prompt_editor_dock_action = QAction(language_wrapper.language_word_dict.get(
107
+ "extend_tools_menu_cot_prompt_editor_dock_action"))
108
+ ui_we_want_to_set.tools_cot_prompt_editor_dock_action.triggered.connect(
109
+ lambda: add_dock(ui_we_want_to_set, "CoTPromptEditor"))
110
+ ui_we_want_to_set.dock_ai_menu.addAction(ui_we_want_to_set.tools_cot_prompt_editor_dock_action)
111
+
112
+ ui_we_want_to_set.tools_skill_prompt_editor_dock_action = QAction(language_wrapper.language_word_dict.get(
113
+ "extend_tools_menu_skill_prompt_editor_dock_action"))
114
+ ui_we_want_to_set.tools_skill_prompt_editor_dock_action.triggered.connect(
115
+ lambda: add_dock(ui_we_want_to_set, "SkillPromptEditor"))
116
+ ui_we_want_to_set.dock_ai_menu.addAction(ui_we_want_to_set.tools_skill_prompt_editor_dock_action)
117
+
118
+ ui_we_want_to_set.tools_skill_send_dock_action = QAction(language_wrapper.language_word_dict.get(
119
+ "extend_tools_menu_skill_prompt_send_dock_action"))
120
+ ui_we_want_to_set.tools_skill_send_dock_action.triggered.connect(
121
+ lambda: add_dock(ui_we_want_to_set, "SkillSendGUI"))
122
+ ui_we_want_to_set.dock_ai_menu.addAction(ui_we_want_to_set.tools_skill_send_dock_action)
123
+
124
+ def add_dock(ui_we_want_to_set: AutomationEditor, widget_type: str = None):
125
+ jeditor_logger.info("build_dock_menu.py add_dock_widget "
126
+ f"ui_we_want_to_set: {ui_we_want_to_set} "
127
+ f"widget_type: {widget_type}")
128
+
129
+ # 建立一個可銷毀的 Dock 容器
130
+ # Create a destroyable dock container
131
+ dock_widget = DestroyDock()
132
+
133
+ if widget_type == "SSH":
134
+ dock_widget.setWindowTitle(language_wrapper.language_word_dict.get(
135
+ "extend_tools_menu_ssh_client_dock_title"
136
+ ))
137
+ dock_widget.setWidget(SSHMainWidget())
138
+ elif widget_type == "AICodeReview":
139
+ dock_widget.setWindowTitle(language_wrapper.language_word_dict.get(
140
+ "extend_tools_menu_ai_code_review_dock_title"
141
+ ))
142
+ dock_widget.setWidget(AICodeReviewClient())
143
+ elif widget_type == "CoTPromptEditor":
144
+ dock_widget.setWindowTitle(language_wrapper.language_word_dict.get(
145
+ "extend_tools_menu_cot_prompt_editor_dock_title"
146
+ ))
147
+ dock_widget.setWidget(CoTPromptEditor())
148
+ elif widget_type == "SkillPromptEditor":
149
+ dock_widget.setWindowTitle(language_wrapper.language_word_dict.get(
150
+ "extend_tools_menu_skill_prompt_editor_dock_title"
151
+ ))
152
+ dock_widget.setWidget(SkillPromptEditor())
153
+ elif widget_type == "SkillSendGUI":
154
+ dock_widget.setWindowTitle(language_wrapper.language_word_dict.get(
155
+ "extend_tools_menu_skill_prompt_send_dock_title"
156
+ ))
157
+ dock_widget.setWidget(SkillsSendGUI())
158
+
159
+ # 如果成功建立了 widget,將其加到主視窗右側 Dock 區域
160
+ # If widget is created, add it to the right dock area of the main window
161
+ if dock_widget.widget() is not None:
162
+ ui_we_want_to_set.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, dock_widget)
@@ -0,0 +1,21 @@
1
+ from PySide6.QtWidgets import QWidget, QGridLayout, QTextEdit, QScrollArea
2
+
3
+
4
+ class CodeWindow(QWidget):
5
+
6
+ def __init__(self):
7
+ # UI used to show run code or shell command result.
8
+ super().__init__()
9
+ self.python_compiler = None
10
+ self.grid_layout = QGridLayout()
11
+ self.code_result = QTextEdit()
12
+ self.code_result.setLineWrapMode(self.code_result.LineWrapMode.NoWrap)
13
+ self.code_result.setReadOnly(True)
14
+ self.code_result_scroll_area = QScrollArea()
15
+ self.code_result_scroll_area.setWidgetResizable(True)
16
+ self.code_result_scroll_area.setViewportMargins(0, 0, 0, 0)
17
+ self.code_result_scroll_area.setWidget(self.code_result)
18
+ self.grid_layout.addWidget(self.code_result_scroll_area, 0, 0)
19
+ self.resize(500, 500)
20
+ self.setLayout(self.grid_layout)
21
+ self.setFocus()
File without changes
@@ -0,0 +1,40 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from je_editor import EditorWidget
6
+
7
+ if TYPE_CHECKING:
8
+ from automation_ide.automation_editor_ui.editor_main.main_ui import AutomationEditor
9
+ from PySide6.QtGui import QColor
10
+
11
+ from automation_ide.automation_editor_ui.syntax.syntax_keyword import \
12
+ package_keyword_list
13
+ from automation_ide.utils.manager.package_manager.package_manager_class import package_manager
14
+
15
+ from je_editor import syntax_extend_setting_dict
16
+
17
+
18
+ def syntax_extend_package(main_window: AutomationEditor) -> None:
19
+ syntax_extend_setting_dict.update({".json": {}})
20
+ for package in package_manager.syntax_check_list:
21
+ syntax_extend_setting_dict.get(".json").update(
22
+ {
23
+ package: {
24
+ "words": set(package_keyword_list.get(package)),
25
+ "color": QColor(255, 255, 0)
26
+ }
27
+ }
28
+ )
29
+ syntax_extend_setting_dict.update({".yml": {}})
30
+ syntax_extend_setting_dict.get(".yml").update(
31
+ {
32
+ "test_pioneer": {
33
+ "words": set(package_keyword_list.get("test_pioneer")),
34
+ "color": QColor(255, 153, 0)
35
+ }
36
+ }
37
+ )
38
+ widget = main_window.tab_widget.currentWidget()
39
+ if isinstance(widget, EditorWidget):
40
+ widget.code_edit.reset_highlighter()
@@ -0,0 +1,163 @@
1
+ api_testka_keys: list = [
2
+ "AT_test_api_method", "AT_delegate_async_httpx", "AT_test_api_method_httpx",
3
+ "AT_generate_html", "AT_generate_html_report", "AT_generate_json",
4
+ "AT_generate_json_report", "AT_generate_xml", "AT_generate_xml_report", "AT_execute_action",
5
+ "AT_execute_files", "AT_add_package_to_executor", "AT_add_package_to_callback_executor",
6
+ "AT_flask_mock_server_add_router", "AT_start_flask_mock_server", "AT_scheduler_event_trigger",
7
+ "AT_remove_blocking_scheduler_job", "AT_remove_nonblocking_scheduler_job",
8
+ "AT_start_blocking_scheduler", "AT_start_nonblocking_scheduler",
9
+ "AT_start_all_scheduler", "AT_shutdown_blocking_scheduler", "AT_shutdown_nonblocking_scheduler",
10
+ "test_api_method", "add_command_to_executor", "execute_action", "execute_files", "executor",
11
+ "get_dir_files_as_list", "generate_html", "generate_html_report", "read_action_json",
12
+ "write_action_json", "reformat_json", "generate_json", "generate_json_report",
13
+ "start_apitestka_socket_server",
14
+ "test_record_instance", "dict_to_elements_tree", "elements_tree_to_dict",
15
+ "XMLParser", "reformat_xml_file", "generate_xml", "generate_xml_report",
16
+ "callback_executor", "create_project_dir", "flask_mock_server_instance",
17
+ "request", "redirect", "SchedulerManager"
18
+ ]
19
+
20
+ auto_control_keys: list = [
21
+ "AC_mouse_left", "AC_mouse_right", "AC_mouse_middle", "AC_click_mouse", "AC_get_mouse_table",
22
+ "AC_get_mouse_position", "AC_press_mouse", "AC_release_mouse", "AC_mouse_scroll",
23
+ "AC_set_mouse_position", "AC_get_special_table", "AC_get_keyboard_keys_table",
24
+ "AC_type_keyboard", "AC_press_keyboard_key", "AC_release_keyboard_key", "AC_check_key_is_press",
25
+ "AC_write", "AC_hotkey", "AC_locate_all_image", "AC_locate_image_center",
26
+ "AC_locate_and_click", "AC_screen_size", "AC_screenshot", "AC_set_record_enable", "AC_generate_html",
27
+ "AC_generate_json", "AC_generate_xml", "AC_generate_html_report", "AC_generate_json_report",
28
+ "AC_generate_xml_report", "AC_record", "AC_stop_record", "AC_execute_action",
29
+ "AC_execute_files", "AC_add_package_to_executor", "AC_add_package_to_callback_executor",
30
+ "AC_create_project", "AC_shell_command", "AC_execute_process", "AC_scheduler_event_trigger",
31
+ "AC_remove_blocking_scheduler_job", "AC_remove_nonblocking_scheduler_job",
32
+ "AC_start_blocking_scheduler", "AC_start_nonblocking_scheduler", "AC_start_all_scheduler",
33
+ "AC_shutdown_blocking_scheduler", "AC_shutdown_nonblocking_scheduler",
34
+ "click_mouse", "mouse_keys_table", "get_mouse_position", "press_mouse", "release_mouse",
35
+ "mouse_scroll", "set_mouse_position", "special_mouse_keys_table",
36
+ "keyboard_keys_table", "press_keyboard_key", "release_keyboard_key", "type_keyboard", "check_key_is_press",
37
+ "write", "hotkey", "start_exe", "SchedulerManager", "get_keyboard_keys_table",
38
+ "screen_size", "screenshot", "locate_all_image", "locate_image_center", "locate_and_click",
39
+ "CriticalExit", "AutoControlException", "AutoControlKeyboardException",
40
+ "AutoControlMouseException", "AutoControlCantFindKeyException",
41
+ "AutoControlScreenException", "ImageNotFoundException", "AutoControlJsonActionException",
42
+ "AutoControlRecordException", "AutoControlActionNullException", "AutoControlActionException", "record",
43
+ "stop_record", "read_action_json", "write_action_json", "execute_action", "execute_files", "executor",
44
+ "add_command_to_executor", "multiprocess_timeout", "test_record_instance", "screenshot", "pil_screenshot",
45
+ "generate_html", "generate_html_report", "generate_json", "generate_json_report", "generate_xml",
46
+ "generate_xml_report", "get_dir_files_as_list", "create_project_dir", "start_autocontrol_socket_server",
47
+ "callback_executor", "package_manager", "get_special_table", "ShellManager", "default_shell_manager",
48
+ ]
49
+
50
+ web_runner_keys: list = [
51
+ "WR_get_webdriver_manager", "WR_change_index_of_webdriver", "WR_quit", "WR_SaveTestObject",
52
+ "WR_CleanTestObject", "WR_set_driver", "WR_set_webdriver_options_capability", "WR_find_element",
53
+ "WR_find_elements", "WR_implicitly_wait", "WR_explict_wait", "WR_to_url",
54
+ "WR_forward", "WR_back", "WR_refresh", "WR_switch", "WR_set_script_timeout", "WR_set_page_load_timeout",
55
+ "WR_get_cookies", "WR_get_cookie", "WR_add_cookie", "WR_delete_cookie", "WR_delete_all_cookies",
56
+ "WR_execute", "WR_execute_script", "WR_execute_async_script", "WR_move_to_element",
57
+ "WR_move_to_element_with_offset", "WR_drag_and_drop", "WR_drag_and_drop_offset", "WR_perform",
58
+ "WR_reset_actions", "WR_left_click", "WR_left_click_and_hold", "WR_right_click",
59
+ "WR_left_double_click", "WR_release", "WR_press_key", "WR_release_key",
60
+ "WR_move_by_offset", "WR_pause", "WR_send_keys", "WR_send_keys_to_element", "WR_scroll",
61
+ "WR_check_current_webdriver", "WR_maximize_window", "WR_fullscreen_window", "WR_minimize_window",
62
+ "WR_set_window_size", "WR_set_window_position", "WR_get_window_position",
63
+ "WR_get_window_rect", "WR_set_window_rect", "WR_get_screenshot_as_png", "WR_get_screenshot_as_base64",
64
+ "WR_get_log", "WR_single_quit", "WR_element_submit", "WR_element_clear", "WR_element_get_property",
65
+ "WR_element_get_dom_attribute", "WR_element_get_attribute",
66
+ "WR_element_is_selected", "WR_element_is_enabled", "WR_input_to_element", "WR_click_element",
67
+ "WR_element_is_displayed", "WR_element_value_of_css_property", "WR_element_screenshot",
68
+ "WR_element_change_web_element", "WR_element_check_current_web_element", "WR_element_get_select",
69
+ "WR_set_record_enable", "WR_generate_html", "WR_generate_html_report", "WR_generate_json",
70
+ "WR_generate_json_report", "WR_generate_xml", "WR_generate_xml_report",
71
+ "WR_execute_action", "WR_execute_files", "WR_add_package_to_executor",
72
+ "WR_add_package_to_callback_executor", "WR_scheduler_event_trigger", "WR_remove_blocking_scheduler_job",
73
+ "WR_remove_nonblocking_scheduler_job", "WR_start_blocking_scheduler", "WR_start_nonblocking_scheduler",
74
+ "WR_start_all_scheduler", "WR_shutdown_blocking_scheduler", "WR_shutdown_nonblocking_scheduler",
75
+ "web_element_wrapper", "set_webdriver_options_argument", "SchedulerManager",
76
+ "webdriver_wrapper", "get_webdriver_manager",
77
+ "get_desired_capabilities", "get_desired_capabilities_keys", "add_command_to_executor",
78
+ "execute_action", "execute_files", "executor",
79
+ "generate_html", "generate_html_report",
80
+ "generate_json", "generate_json_report", "read_action_json",
81
+ "generate_xml", "generate_xml_report",
82
+ "start_web_runner_socket_server", "get_dir_files_as_list",
83
+ "TestObject", "create_test_object", "get_test_object_type_list",
84
+ "test_record_instance", "Keys", "callback_executor", "create_project_dir"
85
+ ]
86
+
87
+ load_density_keys: list = [
88
+ "LD_start_test", "LD_generate_html", "LD_generate_html_report", "LD_generate_json", "LD_generate_json_report",
89
+ "LD_generate_xml", "LD_generate_xml_report", "LD_execute_action", "LD_execute_files",
90
+ "LD_add_package_to_executor", "LD_scheduler_event_trigger", "LD_remove_blocking_scheduler_job",
91
+ "LD_remove_nonblocking_scheduler_job", "LD_start_blocking_scheduler", "LD_start_nonblocking_scheduler",
92
+ "LD_start_all_scheduler", "LD_shutdown_blocking_scheduler", "LD_shutdown_nonblocking_scheduler",
93
+ "create_env", "LD_start_test", "SchedulerManager",
94
+ "locust_wrapper_proxy",
95
+ "prepare_env", "prepare_env",
96
+ "test_record_instance",
97
+ "execute_action", "execute_files", "executor", "add_command_to_executor",
98
+ "get_dir_files_as_list",
99
+ "generate_html", "generate_html_report",
100
+ "generate_json", "generate_json_report", "read_action_json",
101
+ "generate_xml", "generate_xml_report",
102
+ "start_load_density_socket_server",
103
+ "SequentialTaskSet", "task", "TaskSet",
104
+ "callback_executor", "create_project_dir"
105
+ ]
106
+
107
+ automation_file_keys: list = [
108
+ "FA_create_file", "FA_copy_file", "FA_rename_file", "FA_remove_file", "FA_copy_all_file_to_dir",
109
+ "FA_copy_specify_extension_file", "FA_copy_dir", "FA_create_dir", "FA_remove_dir_tree",
110
+ "FA_zip_dir", "FA_zip_file", "FA_zip_info", "FA_zip_file_info", "FA_set_zip_password", "FA_unzip_file",
111
+ "FA_read_zip_file", "FA_unzip_all", "FA_drive_later_init",
112
+ "FA_drive_search_all_file", "FA_drive_search_field", "FA_drive_search_file_mimetype",
113
+ "FA_drive_upload_dir_to_folder", "FA_drive_upload_to_folder", "FA_drive_upload_dir_to_drive",
114
+ "FA_drive_upload_to_drive", "FA_drive_add_folder", "FA_drive_share_file_to_anyone",
115
+ "FA_drive_share_file_to_domain", "FA_drive_share_file_to_user", "FA_drive_delete_file",
116
+ "FA_drive_download_file", "FA_drive_download_file_from_folder",
117
+ "FA_execute_action", "FA_execute_files", "FA_add_package_to_executor",
118
+ "FA_scheduler_event_trigger", "FA_remove_blocking_scheduler_job", "FA_remove_nonblocking_scheduler_job",
119
+ "FA_start_blocking_scheduler", "FA_start_nonblocking_scheduler", "FA_start_all_scheduler",
120
+ "FA_shutdown_blocking_scheduler", "FA_shutdown_nonblocking_scheduler",
121
+ "copy_file", "rename_file", "remove_file", "copy_all_file_to_dir", "copy_specify_extension_file",
122
+ "copy_dir", "create_dir", "remove_dir_tree", "zip_dir", "zip_file", "zip_info",
123
+ "zip_file_info", "set_zip_password", "unzip_file", "read_zip_file",
124
+ "unzip_all", "driver_instance", "drive_search_all_file", "drive_search_field", "drive_search_file_mimetype",
125
+ "drive_upload_dir_to_folder", "drive_upload_to_folder", "drive_upload_dir_to_drive", "drive_upload_to_drive",
126
+ "drive_add_folder", "drive_share_file_to_anyone", "drive_share_file_to_domain", "drive_share_file_to_user",
127
+ "drive_delete_file", "drive_download_file", "drive_download_file_from_folder", "execute_action", "execute_files",
128
+ "add_command_to_executor", "read_action_json", "get_dir_files_as_list", "create_project_dir"
129
+ ]
130
+
131
+ mail_thunder_keys: list = [
132
+ "MT_smtp_later_init", "MT_smtp_create_message_with_attach_and_send", "MT_smtp_create_message_and_send",
133
+ "MT_smtp_quit", "MT_imap_later_init", "MT_imap_select_mailbox", "MT_imap_search_mailbox",
134
+ "MT_imap_mail_content_list", "MT_imap_output_all_mail_as_file", "MT_imap_quit",
135
+ "MT_set_mail_thunder_os_environ", "MT_get_mail_thunder_os_environ", "MT_add_package_to_executor",
136
+ "MT_scheduler_event_trigger", "MT_remove_blocking_scheduler_job", "MT_remove_nonblocking_scheduler_job",
137
+ "MT_start_blocking_scheduler", "MT_start_nonblocking_scheduler", "MT_start_all_scheduler",
138
+ "MT_shutdown_blocking_scheduler", "MT_shutdown_nonblocking_scheduler",
139
+ "IMAPWrapper", "imap_instance", "SMTPWrapper", "smtp_instance", "is_need_to_save_content",
140
+ "mail_thunder_content_data_dict", "read_output_content", "write_output_content", "get_mail_thunder_os_environ",
141
+ "set_mail_thunder_os_environ", "read_action_json", "get_dir_files_as_list", "execute_action", "execute_files",
142
+ "add_command_to_executor", "create_project_dir"
143
+ ]
144
+
145
+ test_pioneer_keys: list = [
146
+ "jobs", "pioneer_log",
147
+ "steps",
148
+ "name",
149
+ "run", "with", "run_folder",
150
+ "wait",
151
+ "open_url",
152
+ "open_program", "close_program", "redirect_stdout", "redirect_stderr",
153
+ ]
154
+
155
+ package_keyword_list = {
156
+ "je_auto_control": auto_control_keys,
157
+ "je_load_density": load_density_keys,
158
+ "je_api_testka": api_testka_keys,
159
+ "je_web_runner": web_runner_keys,
160
+ "automation_file": automation_file_keys,
161
+ "mail_thunder": mail_thunder_keys,
162
+ "test_pioneer": test_pioneer_keys
163
+ }
File without changes
File without changes
@@ -0,0 +1,36 @@
1
+ import sys
2
+ from email.mime.multipart import MIMEMultipart
3
+
4
+ from automation_ide.utils.exception.exception_tags import send_html_exception_tag
5
+ from automation_ide.utils.exception.exceptions import ITESendHtmlReportException
6
+
7
+
8
+ def send_after_test(html_report_path: str = None) -> None:
9
+ try:
10
+ from je_mail_thunder import SMTPWrapper
11
+ mail_thunder_smtp: SMTPWrapper = SMTPWrapper()
12
+ if html_report_path is None and mail_thunder_smtp.login_state is True:
13
+ user: str = mail_thunder_smtp.user
14
+ with open("default_name.html", "r+") as file:
15
+ html_string: str = file.read()
16
+ message = mail_thunder_smtp.create_message_with_attach(
17
+ html_string,
18
+ {"Subject": "Test Report", "To": user, "From": user},
19
+ "default_name.html", use_html=True)
20
+ mail_thunder_smtp.send_message(message)
21
+ mail_thunder_smtp.quit()
22
+ elif mail_thunder_smtp.login_state is True:
23
+ user: str = mail_thunder_smtp.user
24
+ with open(html_report_path, "r+") as file:
25
+ html_string: str = file.read()
26
+ message: MIMEMultipart = mail_thunder_smtp.create_message_with_attach(
27
+ html_string,
28
+ {"Subject": "Test Report", "To": user, "From": user},
29
+ html_report_path, use_html=True)
30
+ mail_thunder_smtp.send_message(message)
31
+ mail_thunder_smtp.quit()
32
+ else:
33
+ raise ITESendHtmlReportException
34
+ except ITESendHtmlReportException as error:
35
+ print(repr(error), file=sys.stderr)
36
+ print(send_html_exception_tag, file=sys.stderr)
File without changes
@@ -0,0 +1,66 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Union
4
+
5
+ from automation_ide.extend.process_executor.process_executor_utils import build_process
6
+
7
+ if TYPE_CHECKING:
8
+ from automation_ide.automation_editor_ui.editor_main.main_ui import AutomationEditor
9
+ import sys
10
+
11
+ from automation_ide.utils.file_process.get_dir_file_list import ask_and_get_dir_files_as_list
12
+
13
+
14
+ def call_api_testka(
15
+ main_window: AutomationEditor,
16
+ exec_str: Union[str, None] = None,
17
+ program_buffer: int = 1024000
18
+ ):
19
+ build_process(main_window, "je_api_testka", exec_str, False, program_buffer)
20
+
21
+
22
+ def call_api_testka_with_send(
23
+ main_window: AutomationEditor,
24
+ exec_str: Union[str, None] = None,
25
+ program_buffer: int = 1024000
26
+ ):
27
+ build_process(main_window, "je_api_testka", exec_str, True, program_buffer)
28
+
29
+
30
+ def call_api_testka_multi_file(
31
+ main_window: AutomationEditor,
32
+ program_buffer: int = 1024000
33
+ ):
34
+ try:
35
+ need_to_execute_list: list = ask_and_get_dir_files_as_list(main_window)
36
+ if need_to_execute_list is not None \
37
+ and isinstance(need_to_execute_list, list) and len(need_to_execute_list) > 0:
38
+ for execute_file in need_to_execute_list:
39
+ with open(execute_file, "r+") as test_script_json:
40
+ call_api_testka(
41
+ main_window,
42
+ test_script_json.read(),
43
+ program_buffer
44
+ )
45
+ except Exception as error:
46
+ print(repr(error), file=sys.stderr)
47
+
48
+
49
+ def call_api_testka_multi_file_and_send(
50
+ main_window: AutomationEditor,
51
+ program_buffer: int = 1024000
52
+ ):
53
+ try:
54
+
55
+ need_to_execute_list: list = ask_and_get_dir_files_as_list(main_window)
56
+ if need_to_execute_list is not None \
57
+ and isinstance(need_to_execute_list, list) and len(need_to_execute_list) > 0:
58
+ for execute_file in need_to_execute_list:
59
+ with open(execute_file, "r+") as test_script_json:
60
+ call_api_testka_with_send(
61
+ main_window,
62
+ test_script_json.read(),
63
+ program_buffer
64
+ )
65
+ except Exception as error:
66
+ print(repr(error), file=sys.stderr)
@@ -0,0 +1,62 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Union
4
+
5
+ from automation_ide.extend.process_executor.process_executor_utils import build_process
6
+
7
+ if TYPE_CHECKING:
8
+ from automation_ide.automation_editor_ui.editor_main.main_ui import AutomationEditor
9
+ import sys
10
+
11
+ from automation_ide.utils.file_process.get_dir_file_list import ask_and_get_dir_files_as_list
12
+
13
+
14
+ def call_auto_control(
15
+ main_window: AutomationEditor,
16
+ exec_str: Union[str, None] = None,
17
+ program_buffer: int = 1024000
18
+ ):
19
+ build_process(main_window, "je_auto_control", exec_str, False, program_buffer)
20
+
21
+
22
+ def call_auto_control_with_send(
23
+ main_window: AutomationEditor,
24
+ exec_str: Union[str, None] = None,
25
+ program_buffer: int = 1024000
26
+ ):
27
+ build_process(main_window, "je_auto_control", exec_str, True, program_buffer)
28
+
29
+
30
+ def call_auto_control_multi_file(
31
+ main_window: AutomationEditor,
32
+ program_buffer: int = 1024000
33
+ ):
34
+ need_to_execute_list: list = ask_and_get_dir_files_as_list(main_window)
35
+ if need_to_execute_list is not None \
36
+ and isinstance(need_to_execute_list, list) and len(need_to_execute_list) > 0:
37
+ for execute_file in need_to_execute_list:
38
+ with open(execute_file, "r+") as test_script_json:
39
+ call_auto_control(
40
+ main_window,
41
+ test_script_json.read(),
42
+ program_buffer
43
+ )
44
+
45
+
46
+ def call_auto_control_multi_file_and_send(
47
+ main_window: AutomationEditor,
48
+ program_buffer: int = 1024000
49
+ ):
50
+ try:
51
+ need_to_execute_list: list = ask_and_get_dir_files_as_list(main_window)
52
+ if need_to_execute_list is not None \
53
+ and isinstance(need_to_execute_list, list) and len(need_to_execute_list) > 0:
54
+ for execute_file in need_to_execute_list:
55
+ with open(execute_file, "r+") as test_script_json:
56
+ call_auto_control_with_send(
57
+ main_window,
58
+ test_script_json.read(),
59
+ program_buffer
60
+ )
61
+ except Exception as error:
62
+ print(repr(error), file=sys.stderr)