mirror of
https://github.com/KenanZhu/AutoLibrary.git
synced 2026-06-18 23:43:02 +08:00
fix(ALMainWorkers): 修复 AutoLibWorker 中基础检查未通过时,运行线程错误返回导致结束信号未发送的问题
This commit is contained in:
@@ -44,8 +44,7 @@ class AutoLibWorker(QThread, MsgBase):
|
|||||||
current_time = time.strftime("%H:%M", time.localtime())
|
current_time = time.strftime("%H:%M", time.localtime())
|
||||||
if current_time >= "23:30" or current_time <= "07:30":
|
if current_time >= "23:30" or current_time <= "07:30":
|
||||||
self._showTrace(
|
self._showTrace(
|
||||||
"当前时间不在图书馆开放时间内\n"\
|
"当前时间不在图书馆开放时间内, 请在 07:30 - 23:30 之间尝试"
|
||||||
" 请在 07:30 - 23:30 之间尝试"
|
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
@@ -58,7 +57,7 @@ class AutoLibWorker(QThread, MsgBase):
|
|||||||
if not all(
|
if not all(
|
||||||
os.path.exists(path) for path in self.__config_paths.values()
|
os.path.exists(path) for path in self.__config_paths.values()
|
||||||
):
|
):
|
||||||
self._showTrace("配置文件路径不存在, 请检查配置文件路径是否正确。")
|
self._showTrace("配置文件路径不存在, 请检查配置文件路径是否正确")
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -96,12 +95,13 @@ class AutoLibWorker(QThread, MsgBase):
|
|||||||
):
|
):
|
||||||
|
|
||||||
auto_lib = None
|
auto_lib = None
|
||||||
try:
|
|
||||||
if not self.checkTimeAvailable():
|
|
||||||
return
|
|
||||||
if not self.checkConfigPaths():
|
|
||||||
return
|
|
||||||
self._showTrace("AutoLibrary 开始运行")
|
self._showTrace("AutoLibrary 开始运行")
|
||||||
|
if not self.checkTimeAvailable()\
|
||||||
|
or not self.checkConfigPaths():
|
||||||
|
# time or config existence check failed, skip and finish
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
try:
|
||||||
if not self.loadConfigs():
|
if not self.loadConfigs():
|
||||||
raise Exception("配置文件加载失败")
|
raise Exception("配置文件加载失败")
|
||||||
auto_lib = AutoLib(
|
auto_lib = AutoLib(
|
||||||
|
|||||||
Reference in New Issue
Block a user