File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
2-
3- # Included modules
42import os
53import sys
64
@@ -35,13 +33,20 @@ def main():
3533
3634 if main and (main .update_after_shutdown or main .restart_after_shutdown ): # Updater
3735 if main .update_after_shutdown :
36+ print ("Shutting down..." )
37+ prepareShutdown ()
3838 import update
39+ print ("Updating..." )
3940 update .update ()
41+ print ("Restarting..." )
4042 restart ()
4143 else :
44+ print ("Shutting down..." )
45+ prepareShutdown ()
4246 print ("Restarting..." )
4347 restart ()
4448
49+
4550def displayErrorMessage (err , error_log_path ):
4651 import ctypes
4752 import urllib .parse
@@ -64,22 +69,23 @@ def displayErrorMessage(err, error_log_path):
6469 if res in [ID_YES , ID_NO ]:
6570 subprocess .Popen (['notepad.exe' , error_log_path ])
6671
72+ def prepareShutdown ():
73+ import atexit
74+ atexit ._run_exitfuncs ()
6775
68- def restart ():
76+ # Close log files
6977 if "main" in sys .modules :
70- import atexit
71- # Close log files
7278 logger = sys .modules ["main" ].logging .getLogger ()
7379
7480 for handler in logger .handlers [:]:
7581 handler .flush ()
7682 handler .close ()
7783 logger .removeHandler (handler )
7884
79- atexit ._run_exitfuncs ()
80- import time
81- time .sleep (1 ) # Wait files to close
85+ import time
86+ time .sleep (1 ) # Wait files to close
8287
88+ def restart ():
8389 args = sys .argv [:]
8490
8591 sys .executable = sys .executable .replace (".pkg" , "" ) # Frozen mac fix
You can’t perform that action at this time.
0 commit comments