Skip to content

Commit 303826e

Browse files
authored
Merge pull request #54 from JE-Chen/dev
Dev
2 parents 7ce801b + d8f7376 commit 303826e

File tree

9 files changed

+42
-33
lines changed

9 files changed

+42
-33
lines changed

.idea/workspace.xml

Lines changed: 26 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from je_auto_control import start_autocontrol_socket_server
22

3-
if "__main__" == __name__:
3+
try:
44
server = start_autocontrol_socket_server()
55
while not server.close_flag:
66
pass
7+
except Exception as error:
8+
print(repr(error))
Binary file not shown.

dev_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="je_auto_control_dev",
8-
version="0.0.36",
8+
version="0.0.38",
99
author="JE-Chen",
1010
author_email="zenmailman@gmail.com",
1111
description="auto testing",

je_auto_control/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@
7575
from je_auto_control.utils.file_process.get_dir_file_list import get_dir_files_as_list
7676
from je_auto_control.utils.file_process.create_project_structure import create_template_dir
7777
# socket server
78-
from je_auto_control.utils.socket_server.AutoControlSocketServer import start_autocontrol_socket_server
78+
from je_auto_control.utils.socket_server.auto_control_socket_server import start_autocontrol_socket_server

je_auto_control/utils/executor/action_executor.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def __init__(self):
5656
def _execute_event(self, action: list):
5757
event = self.event_dict.get(action[0])
5858
if len(action) == 2:
59-
event(**action[1])
59+
return event(**action[1])
6060
elif len(action) == 1:
61-
event()
61+
return event()
6262
else:
6363
raise AutoControlActionException(cant_execute_action_error + " " + str(action))
6464

@@ -80,19 +80,19 @@ def execute_action(self, action_list: [list, dict]) -> dict:
8080
raise AutoControlActionNullException(action_is_null_error)
8181
except Exception as error:
8282
record_action_to_list("execute_action", action_list, repr(error))
83-
print(repr(error), file=sys.stderr)
83+
print(repr(error), file=sys.stderr, flush=True)
8484
for action in action_list:
8585
try:
8686
event_response = self._execute_event(action)
8787
execute_record = "execute: " + str(action)
8888
execute_record_dict.update({execute_record: event_response})
8989
except Exception as error:
90-
print(repr(error), file=sys.stderr)
91-
print(action, file=sys.stderr)
90+
print(repr(error), file=sys.stderr, flush=True)
91+
print(action, file=sys.stderr, flush=True)
9292
record_action_to_list("execute_action", None, repr(error))
9393
for key, value in execute_record_dict.items():
94-
print(key)
95-
print(value)
94+
print(key, flush=True)
95+
print(value, flush=True)
9696
return execute_record_dict
9797

9898
def execute_files(self, execute_files_list: list) -> list:

je_auto_control/utils/socket_server/AutoControlSocketServer.py renamed to je_auto_control/utils/socket_server/auto_control_socket_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class TCPServerHandler(socketserver.BaseRequestHandler):
99

1010
def handle(self):
1111
command_string = str(self.request.recv(8192).strip(), encoding="utf-8")
12-
print("command is: " + command_string)
12+
print("command is: " + command_string, flush=True)
1313
if command_string == "quit_server":
1414
self.server.shutdown()
1515
self.server.close_flag = True
16-
print("Now quit server")
16+
print("Now quit server", flush=True)
1717
else:
1818
try:
1919
execute_str = json.loads(command_string)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="je_auto_control",
8-
version="0.0.103",
8+
version="0.0.104",
99
author="JE-Chen",
1010
author_email="zenmailman@gmail.com",
1111
description="auto testing",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from je_auto_control.utils.socket_server.AutoControlSocketServer import start_autocontrol_socket_server
1+
from je_auto_control.utils.socket_server.auto_control_socket_server import start_autocontrol_socket_server
22

33
server = start_autocontrol_socket_server()
44
server.server_close()

0 commit comments

Comments
 (0)