mirror of
https://gitlab.os-k.eu/neox/CNIRevelator.git
synced 2023-08-25 14:03:10 +02:00
Correcting the Shutdown System
This commit is contained in:
parent
9db083ba38
commit
75e0a85a86
@ -34,11 +34,14 @@ import launcher # launcher.py
|
||||
import updater # updater.py
|
||||
import globs # globs.py
|
||||
import pytesseract # pytesseract.py
|
||||
import logger # logger.py
|
||||
|
||||
# Global handler
|
||||
logfile = logger.logCur
|
||||
|
||||
## MAIN FUNCTION OF CNIREVELATOR
|
||||
def main():
|
||||
import logger # logger.py
|
||||
logfile = logger.logCur
|
||||
|
||||
|
||||
logfile.printdbg('*** CNIRevelator LOGFILE. Hello World ! ***')
|
||||
|
||||
@ -70,7 +73,7 @@ try:
|
||||
launcherThread = threading.Thread(target=updater.umain, daemon=False)
|
||||
launcher.lmain(launcherThread)
|
||||
except Exception:
|
||||
sys.exit(1)
|
||||
updater.exitProcess(1)
|
||||
|
||||
if updater.UPDATE_IS_MADE:
|
||||
# Launch app !
|
||||
@ -83,15 +86,10 @@ if updater.UPDATE_IS_MADE:
|
||||
time.sleep(3)
|
||||
continue
|
||||
break
|
||||
sys.exit(0)
|
||||
updater.exitProcess(0)
|
||||
|
||||
# Here we go !
|
||||
try:
|
||||
main()
|
||||
except Exception:
|
||||
sys.exit(1)
|
||||
|
||||
# Quit totally without remain in memory
|
||||
for process in psutil.process_iter():
|
||||
if process.pid == os.getpid():
|
||||
process.terminate()
|
||||
updater.exitProcess(1)
|
@ -63,6 +63,13 @@ def createShortcut(path, target='', wDir='', icon=''):
|
||||
def spawnProcess(args, cd):
|
||||
subprocess.Popen(args, close_fds=True, cwd=cd, creationflags=subprocess.DETACHED_PROCESS)
|
||||
|
||||
def exitProcess(arg):
|
||||
# Quit totally without remain in memory
|
||||
for process in psutil.process_iter():
|
||||
if process.pid == os.getpid():
|
||||
process.terminate()
|
||||
sys.exit(arg)
|
||||
|
||||
## Main Batch Function
|
||||
def batch():
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user