add requirements.txt and modify xService package format

This commit is contained in:
gitea 2024-09-26 20:00:59 +08:00
parent 7f1e794f48
commit edeeb04a62
2 changed files with 5 additions and 2 deletions

View File

@ -0,0 +1,3 @@
loguru==0.7.2
paramiko==3.5.0
pymodbus==3.7.2

View File

@ -600,7 +600,7 @@ class HmiRequest(object):
@staticmethod
def __package_xs(cmd):
return f"{dumps(cmd, separators=(",", ":"))}\r".encode()
return "".join([dumps(cmd, separators=(",", ":")), "\r"]).encode()
def __unpackage(self, sock):
def to_read(conn, mask):
@ -1757,7 +1757,7 @@ class HmiRequest(object):
:return: None
"""
origin_code_list = self.get_filtered_error_code["g"]["log_code.data"]["code_list"]
# [{'id': 10000, 'title': 'HMI请求包解析错误'}, {'id': 10002, 'title': '快速调整启动失败'}]
# [{"id": 10000, "title": "HMI请求包解析错误"}, {"id": 10002, "title": "快速调整启动失败"}]
if action == "clear":
code_list = []
elif action == "add":