mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-03 13:35:18 +00:00
WIP
This commit is contained in:
parent
7e0c298dd7
commit
0fb4160407
1 changed files with 10 additions and 2 deletions
12
bazarr.py
12
bazarr.py
|
@ -31,10 +31,17 @@ check_python_version()
|
|||
dir_name = os.path.dirname(__file__)
|
||||
|
||||
|
||||
def end_child_process(ep):
|
||||
try:
|
||||
ep.kill()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def start_bazarr():
|
||||
script = [sys.executable, "-u", os.path.normcase(os.path.join(dir_name, 'bazarr', 'main.py'))] + sys.argv[1:]
|
||||
ep = subprocess.Popen(script, stdout=None, stderr=None, stdin=subprocess.DEVNULL)
|
||||
atexit.register(lambda: ep.kill())
|
||||
atexit.register(end_child_process, ep=ep)
|
||||
|
||||
|
||||
def check_status():
|
||||
|
@ -85,4 +92,5 @@ if __name__ == '__main__':
|
|||
else:
|
||||
os.wait()
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
pass
|
||||
print('Bazarr exited.')
|
||||
sys.exit(0)
|
||||
|
|
Loading…
Reference in a new issue