1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 09:48:20 +08:00

Opt: LaunchPath insted of CmdLine

This commit is contained in:
hgjazhgj
2023-05-27 21:22:33 +08:00
parent 742e34c8d0
commit b4af10b56b
12 changed files with 88 additions and 25 deletions

View File

@@ -7,11 +7,18 @@ from threading import Thread
class HeadlessCliApplication:
"""Wrap a cli application to provide programmable interactive access"""
def __init__(self, cmd):
def __init__(self, launch, halt = ""):
self.pipe = Popen(
shlex.split(cmd, posix=os.name=="posix"),
[launch],
stdin=PIPE, stdout=PIPE, stderr=STDOUT, text=True
)
self.orphanSlayer = Popen([
"python",
os.path.join(os.path.dirname(__file__), "orphanSlayer.py"),
str(os.getpid()),
str(self.pipe.pid),
halt,
])
def f():
while True: