修复BUG:run无法异常退出,主程序检测目录错误
This commit is contained in:
BIN
AUTO_MAA.exe
BIN
AUTO_MAA.exe
Binary file not shown.
@@ -60,7 +60,7 @@ while True:
|
|||||||
print(colored(linex,'light_green'))
|
print(colored(linex,'light_green'))
|
||||||
else:
|
else:
|
||||||
print(colored("暂无",'light_green'))
|
print(colored("暂无",'light_green'))
|
||||||
if (curtime in timeset) and not os.path.exists("running"):
|
if (curtime in timeset) and not os.path.exists("state/running"):
|
||||||
with open("state/BEGIN","w",encoding="utf-8") as f:
|
with open("state/BEGIN","w",encoding="utf-8") as f:
|
||||||
print("BEGIN",file=f)
|
print("BEGIN",file=f)
|
||||||
maa=subprocess.Popen(["run.exe"])
|
maa=subprocess.Popen(["run.exe"])
|
||||||
|
|||||||
BIN
manage.exe
BIN
manage.exe
Binary file not shown.
@@ -448,7 +448,7 @@ while True:
|
|||||||
elif read[0]=='+' and len(read)==1:
|
elif read[0]=='+' and len(read)==1:
|
||||||
print(add())
|
print(add())
|
||||||
elif read[0]=='-' and len(read)==1:
|
elif read[0]=='-' and len(read)==1:
|
||||||
exit()
|
os._exit(0)
|
||||||
elif read[0]=='/':
|
elif read[0]=='/':
|
||||||
print(setpath(read[1:]))
|
print(setpath(read[1:]))
|
||||||
elif read[0]=='*' and len(read)==1:
|
elif read[0]=='*' and len(read)==1:
|
||||||
|
|||||||
5
run.py
5
run.py
@@ -19,6 +19,7 @@
|
|||||||
# DLmaster_361@163.com
|
# DLmaster_361@163.com
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import atexit
|
import atexit
|
||||||
import sqlite3
|
import sqlite3
|
||||||
@@ -116,7 +117,7 @@ def cleanup():
|
|||||||
|
|
||||||
#读取运行情况
|
#读取运行情况
|
||||||
if os.path.exists("state/RUNNING"):
|
if os.path.exists("state/RUNNING"):
|
||||||
exit()
|
os._exit(1)
|
||||||
#标记当前正在运行
|
#标记当前正在运行
|
||||||
with open("state/RUNNING","w",encoding="utf-8") as f:
|
with open("state/RUNNING","w",encoding="utf-8") as f:
|
||||||
print("RUNNING",file=f)
|
print("RUNNING",file=f)
|
||||||
@@ -173,4 +174,4 @@ with open("log.txt","w",encoding="utf-8") as f:
|
|||||||
if os.path.exists("state/BEGIN"):
|
if os.path.exists("state/BEGIN"):
|
||||||
with open("state/END","w",encoding="utf-8") as f:
|
with open("state/END","w",encoding="utf-8") as f:
|
||||||
print("END",file=f)
|
print("END",file=f)
|
||||||
exit()
|
sys.exit(0)
|
||||||
Reference in New Issue
Block a user