mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-04-20 09:31:43 -04:00
#278: fix an exit via misc.restart.restart_application
as graceful.
This commit is contained in:
parent
d441536f01
commit
6311d541da
@ -656,7 +656,7 @@ class Controller(object):
|
|||||||
sessions.sessions[item].shelve()
|
sessions.sessions[item].shelve()
|
||||||
if system == "Windows":
|
if system == "Windows":
|
||||||
self.systrayIcon.RemoveIcon()
|
self.systrayIcon.RemoveIcon()
|
||||||
pidpath = os.path.join(os.getenv("temp"), "{}.pid".format(application.name))
|
pidpath = os.path.join(os.getenv("temp"), "client.pid")
|
||||||
if os.path.exists(pidpath):
|
if os.path.exists(pidpath):
|
||||||
os.remove(pidpath)
|
os.remove(pidpath)
|
||||||
widgetUtils.exit_application()
|
widgetUtils.exit_application()
|
||||||
|
@ -113,7 +113,7 @@ def is_running(pid):
|
|||||||
|
|
||||||
def check_pid():
|
def check_pid():
|
||||||
"Insures that only one copy of the application is running at a time."
|
"Insures that only one copy of the application is running at a time."
|
||||||
pidpath = os.path.join(os.getenv("temp"), "{}.pid".format(application.name))
|
pidpath = os.path.join(os.getenv("temp"), "client.pid")
|
||||||
if os.path.exists(pidpath):
|
if os.path.exists(pidpath):
|
||||||
with open(pidpath) as fin:
|
with open(pidpath) as fin:
|
||||||
pid = int(fin.read())
|
pid = int(fin.read())
|
||||||
|
@ -7,5 +7,8 @@ def restart_program():
|
|||||||
if not hasattr(sys, "frozen"):
|
if not hasattr(sys, "frozen"):
|
||||||
args.insert(0, sys.executable)
|
args.insert(0, sys.executable)
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
|
pidpath = os.path.join(os.getenv("temp"), "client.pid")
|
||||||
|
if os.path.exists(pidpath):
|
||||||
|
os.remove(pidpath)
|
||||||
args = ['"%s"' % arg for arg in args]
|
args = ['"%s"' % arg for arg in args]
|
||||||
os.execv(sys.executable, args)
|
os.execv(sys.executable, args)
|
Loading…
x
Reference in New Issue
Block a user