解决log_text过长导致的log显示于中间
This commit is contained in:
36
AUTO_MAA.py
36
AUTO_MAA.py
@@ -185,6 +185,7 @@ class MaaRunner(QtCore.QThread):
|
|||||||
# 合并日志
|
# 合并日志
|
||||||
log = "".join(logs)
|
log = "".join(logs)
|
||||||
# 更新MAA日志
|
# 更新MAA日志
|
||||||
|
if len(logs) > 10000:
|
||||||
self.update_gui.emit(
|
self.update_gui.emit(
|
||||||
self.data[index][0]
|
self.data[index][0]
|
||||||
+ "_第"
|
+ "_第"
|
||||||
@@ -194,7 +195,19 @@ class MaaRunner(QtCore.QThread):
|
|||||||
"\n".join([self.data[_][0] for _ in wait_index]),
|
"\n".join([self.data[_][0] for _ in wait_index]),
|
||||||
"\n".join([self.data[_][0] for _ in over_index]),
|
"\n".join([self.data[_][0] for _ in over_index]),
|
||||||
"\n".join([self.data[_][0] for _ in error_index]),
|
"\n".join([self.data[_][0] for _ in error_index]),
|
||||||
log,
|
"".join(logs[-10000:]),
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.update_gui.emit(
|
||||||
|
self.data[index][0]
|
||||||
|
+ "_第"
|
||||||
|
+ str(i + 1)
|
||||||
|
+ "次_"
|
||||||
|
+ mode_book[j][5:7],
|
||||||
|
"\n".join([self.data[_][0] for _ in wait_index]),
|
||||||
|
"\n".join([self.data[_][0] for _ in over_index]),
|
||||||
|
"\n".join([self.data[_][0] for _ in error_index]),
|
||||||
|
"".join(logs),
|
||||||
)
|
)
|
||||||
# 判断MAA程序运行状态
|
# 判断MAA程序运行状态
|
||||||
result = self.if_maa_success(log, mode_book[j])
|
result = self.if_maa_success(log, mode_book[j])
|
||||||
@@ -307,12 +320,29 @@ class MaaRunner(QtCore.QThread):
|
|||||||
# 合并日志
|
# 合并日志
|
||||||
log = "".join(logs)
|
log = "".join(logs)
|
||||||
# 更新MAA日志
|
# 更新MAA日志
|
||||||
|
if len(logs) > 10000:
|
||||||
self.update_gui.emit(
|
self.update_gui.emit(
|
||||||
self.data[index][0],
|
self.data[index][0]
|
||||||
|
+ "_第"
|
||||||
|
+ str(i + 1)
|
||||||
|
+ "次_"
|
||||||
|
+ mode_book[j][5:7],
|
||||||
"\n".join([self.data[_][0] for _ in wait_index]),
|
"\n".join([self.data[_][0] for _ in wait_index]),
|
||||||
"\n".join([self.data[_][0] for _ in over_index]),
|
"\n".join([self.data[_][0] for _ in over_index]),
|
||||||
"\n".join([self.data[_][0] for _ in error_index]),
|
"\n".join([self.data[_][0] for _ in error_index]),
|
||||||
log,
|
"".join(logs[-10000:]),
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.update_gui.emit(
|
||||||
|
self.data[index][0]
|
||||||
|
+ "_第"
|
||||||
|
+ str(i + 1)
|
||||||
|
+ "次_"
|
||||||
|
+ mode_book[j][5:7],
|
||||||
|
"\n".join([self.data[_][0] for _ in wait_index]),
|
||||||
|
"\n".join([self.data[_][0] for _ in over_index]),
|
||||||
|
"\n".join([self.data[_][0] for _ in error_index]),
|
||||||
|
"".join(logs),
|
||||||
)
|
)
|
||||||
# 判断MAA程序运行状态
|
# 判断MAA程序运行状态
|
||||||
result = self.if_maa_success(log, "人工排查")
|
result = self.if_maa_success(log, "人工排查")
|
||||||
|
|||||||
Reference in New Issue
Block a user