Skip to content
Merged

Dev #54

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 26 additions & 19 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion autocontrol_driver/generate_autocontrol_driver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from je_auto_control import start_autocontrol_socket_server

if "__main__" == __name__:
try:
server = start_autocontrol_socket_server()
while not server.close_flag:
pass
except Exception as error:
print(repr(error))
Binary file not shown.
2 changes: 1 addition & 1 deletion dev_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="je_auto_control_dev",
version="0.0.36",
version="0.0.38",
author="JE-Chen",
author_email="[email protected]",
description="auto testing",
Expand Down
2 changes: 1 addition & 1 deletion je_auto_control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@
from je_auto_control.utils.file_process.get_dir_file_list import get_dir_files_as_list
from je_auto_control.utils.file_process.create_project_structure import create_template_dir
# socket server
from je_auto_control.utils.socket_server.AutoControlSocketServer import start_autocontrol_socket_server
from je_auto_control.utils.socket_server.auto_control_socket_server import start_autocontrol_socket_server
14 changes: 7 additions & 7 deletions je_auto_control/utils/executor/action_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def __init__(self):
def _execute_event(self, action: list):
event = self.event_dict.get(action[0])
if len(action) == 2:
event(**action[1])
return event(**action[1])
elif len(action) == 1:
event()
return event()
else:
raise AutoControlActionException(cant_execute_action_error + " " + str(action))

Expand All @@ -80,19 +80,19 @@ def execute_action(self, action_list: [list, dict]) -> dict:
raise AutoControlActionNullException(action_is_null_error)
except Exception as error:
record_action_to_list("execute_action", action_list, repr(error))
print(repr(error), file=sys.stderr)
print(repr(error), file=sys.stderr, flush=True)
for action in action_list:
try:
event_response = self._execute_event(action)
execute_record = "execute: " + str(action)
execute_record_dict.update({execute_record: event_response})
except Exception as error:
print(repr(error), file=sys.stderr)
print(action, file=sys.stderr)
print(repr(error), file=sys.stderr, flush=True)
print(action, file=sys.stderr, flush=True)
record_action_to_list("execute_action", None, repr(error))
for key, value in execute_record_dict.items():
print(key)
print(value)
print(key, flush=True)
print(value, flush=True)
return execute_record_dict

def execute_files(self, execute_files_list: list) -> list:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class TCPServerHandler(socketserver.BaseRequestHandler):

def handle(self):
command_string = str(self.request.recv(8192).strip(), encoding="utf-8")
print("command is: " + command_string)
print("command is: " + command_string, flush=True)
if command_string == "quit_server":
self.server.shutdown()
self.server.close_flag = True
print("Now quit server")
print("Now quit server", flush=True)
else:
try:
execute_str = json.loads(command_string)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="je_auto_control",
version="0.0.103",
version="0.0.104",
author="JE-Chen",
author_email="[email protected]",
description="auto testing",
Expand Down
2 changes: 1 addition & 1 deletion test/unit_test/socket_server_test/socket_server_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from je_auto_control.utils.socket_server.AutoControlSocketServer import start_autocontrol_socket_server
from je_auto_control.utils.socket_server.auto_control_socket_server import start_autocontrol_socket_server

server = start_autocontrol_socket_server()
server.server_close()