-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathweb_runner_process.py
More file actions
66 lines (53 loc) · 2.26 KB
/
web_runner_process.py
File metadata and controls
66 lines (53 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from __future__ import annotations
from typing import TYPE_CHECKING, Union
from pybreeze.extend.process_executor.process_executor_utils import build_process
if TYPE_CHECKING:
from pybreeze.pybreeze_ui.editor_main.main_ui import PyBreezeMainWindow
import sys
from pybreeze.utils.file_process.get_dir_file_list import ask_and_get_dir_files_as_list
def call_web_runner_test(
main_window: PyBreezeMainWindow,
exec_str: Union[str, None] = None,
program_buffer: int = 1024000
):
build_process(main_window, "je_web_runner", exec_str, False, program_buffer)
def call_web_runner_test_with_send(
main_window: PyBreezeMainWindow,
exec_str: Union[str, None] = None,
program_buffer: int = 1024000
):
build_process(main_window, "je_web_runner", exec_str, True, program_buffer)
def call_web_runner_test_multi_file(
main_window: PyBreezeMainWindow,
program_buffer: int = 1024000
):
try:
need_to_execute_list: list = ask_and_get_dir_files_as_list(main_window)
if need_to_execute_list is not None and isinstance(need_to_execute_list, list) and len(
need_to_execute_list) > 0:
for execute_file in need_to_execute_list:
with open(execute_file, "r+") as test_script_json:
call_web_runner_test(
main_window,
test_script_json.read(),
program_buffer
)
except Exception as error:
print(repr(error), file=sys.stderr)
def call_web_runner_test_multi_file_and_send(
main_window: PyBreezeMainWindow,
program_buffer: int = 1024000
):
try:
need_to_execute_list: list = ask_and_get_dir_files_as_list(main_window)
if need_to_execute_list is not None and isinstance(need_to_execute_list, list) and len(
need_to_execute_list) > 0:
for execute_file in need_to_execute_list:
with open(execute_file, "r+") as test_script_json:
call_web_runner_test_with_send(
main_window,
test_script_json.read(),
program_buffer
)
except Exception as error:
print(repr(error), file=sys.stderr)