Added daemonization option

improved options parsing
This commit is contained in:
Matteo ℱan 2020-02-02 22:10:24 +01:00
parent cbfe1511a2
commit a497d8ddb2
No known key found for this signature in database
GPG key ID: 3C30A05BC133D9B6
7 changed files with 831 additions and 67 deletions

View file

@ -20,12 +20,15 @@ except ImportError:
from tkinter import filedialog
import tkinter.font as tkFont
from pykms_Server import srv_options, srv_version, srv_config, srv_terminate, serverqueue, serverthread
from pykms_Server import srv_options, srv_version, srv_config, server_terminate, serverqueue, serverthread
from pykms_GuiMisc import ToolTip, TextDoubleScroll, TextRedirect, custom_background
from pykms_Client import clt_options, clt_version, clt_config, client_thread
gui_description = 'py-kms GUI'
gui_version = 'v1.0'
gui_version = "py-kms_gui_v2.0"
__license__ = "The Unlicense"
__author__ = u"Matteo an <SystemRage@protonmail.com>"
__url__ = "https://github.com/SystemRage/py-kms"
gui_description = "A GUI for py-kms."
##---------------------------------------------------------------------------------------------------------------------------------------------------------
def get_ip_address():
@ -452,7 +455,7 @@ class KmsGui(tk.Tk):
def srv_actions_stop(self):
if serverthread.is_running_server:
if serverthread.server is not None:
srv_terminate(exit_server = True)
server_terminate(serverthread, exit_server = True)
# wait for switch.
while serverthread.is_running_server:
pass
@ -522,10 +525,10 @@ class KmsGui(tk.Tk):
def on_exit(self):
if serverthread.is_running_server:
if serverthread.server is not None:
srv_terminate(exit_server = True)
server_terminate(serverthread, exit_server = True)
else:
serverthread.is_running_server = False
srv_terminate(exit_thread = True)
server_terminate(serverthread, exit_thread = True)
self.destroy()
def on_clear(self, widgetlist):