Skip to content

Commit

Permalink
修复BUG:run无法异常退出,主程序检测目录错误
Browse files Browse the repository at this point in the history
  • Loading branch information
DLmaster authored and DLmaster committed Mar 11, 2024
1 parent 7b789c7 commit 3bcfe6b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 4 deletions.
Binary file modified AUTO_MAA.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion AUTO_MAA.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def cleanup():
print(colored(linex,'light_green'))
else:
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:
print("BEGIN",file=f)
maa=subprocess.Popen(["run.exe"])
Expand Down
Binary file modified manage.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def unit(x,m):
elif read[0]=='+' and len(read)==1:
print(add())
elif read[0]=='-' and len(read)==1:
exit()
os._exit(0)
elif read[0]=='/':
print(setpath(read[1:]))
elif read[0]=='*' and len(read)==1:
Expand Down
Binary file modified run.exe
Binary file not shown.
5 changes: 3 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# [email protected]

import os
import sys
import subprocess
import atexit
import sqlite3
Expand Down Expand Up @@ -116,7 +117,7 @@ def cleanup():

#读取运行情况
if os.path.exists("state/RUNNING"):
exit()
os._exit(1)
#标记当前正在运行
with open("state/RUNNING","w",encoding="utf-8") as f:
print("RUNNING",file=f)
Expand Down Expand Up @@ -173,4 +174,4 @@ def cleanup():
if os.path.exists("state/BEGIN"):
with open("state/END","w",encoding="utf-8") as f:
print("END",file=f)
exit()
sys.exit(0)

0 comments on commit 3bcfe6b

Please sign in to comment.