Removed old gui code references and variables

This commit is contained in:
simonmicro 2022-12-09 19:51:18 +01:00
parent f1fa5b794f
commit 4bd60959f1
No known key found for this signature in database
GPG key ID: 033A4D4CE4E063D6
6 changed files with 11 additions and 48 deletions

View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2020 Matteo an
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -48,4 +48,3 @@ The wiki has been completly reworked and is now available on [readthedocs.com](h
## License
- _py-kms_ is [![Unlicense](https://img.shields.io/badge/license-unlicense-lightgray.svg)](https://github.com/SystemRage/py-kms/blob/master/LICENSE)
- _py-kms GUI_ is [![MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/SystemRage/py-kms/blob/master/LICENSE.gui.md) © Matteo an

View file

@ -45,10 +45,9 @@ class client_thread(threading.Thread):
def __init__(self, name):
threading.Thread.__init__(self)
self.name = name
self.with_gui = False
def run(self):
clt_main(with_gui = self.with_gui)
clt_main()
#---------------------------------------------------------------------------------------------------------------------------------------------------------
@ -297,11 +296,10 @@ def client_create(clt_sock):
pretty_printer(log_obj = loggerclt.warning, to_exit = True, where = "clt",
put_text = "{reverse}{magenta}{bold}Something went wrong. Exiting...{end}")
def clt_main(with_gui = False):
def clt_main():
try:
if not with_gui:
# Parse options.
client_options()
# Parse options.
client_options()
# Check options.
client_check()
@ -393,4 +391,4 @@ def readKmsResponseV6(data):
return message
if __name__ == "__main__":
clt_main(with_gui = False)
clt_main()

View file

@ -400,7 +400,6 @@ def pretty_printer(**kwargs):
if None `put_text` must be defined for printing process.
`to_exit ` --> if True system exit is called.
`where` --> specifies if message is server-side or client-side
(useful for GUI redirect).
"""
# Set defaults for not defined options.
options = {'log_obj' : None,

View file

@ -194,9 +194,6 @@ def logger_create(log_obj, config, mode = 'a'):
frmt_name = '%(name)s '
from pykms_Server import serverthread
if serverthread.with_gui:
frmt_std = frmt_name + frmt_std
frmt_min = frmt_name + frmt_min
def apply_formatter(levelnum, formats, handler, color = False):
levelformdict = {}
@ -521,7 +518,7 @@ def check_setup(config, options, logger, where):
# Check logfile.
config['logfile'] = check_logfile(config['logfile'], options['lfile']['def'], where = where)
# Check logsize (py-kms Gui).
# Check logsize
if config['logsize'] == "":
if any(opt in ['STDOUT', 'FILEOFF'] for opt in config['logfile']):
# set a recognized size never used.
@ -530,7 +527,7 @@ def check_setup(config, options, logger, where):
pretty_printer(put_text = "{reverse}{red}{bold}argument `-S/--logsize`: invalid with: '%s'. Exiting...{end}" %config['logsize'],
where = where, to_exit = True)
# Check loglevel (py-kms Gui).
# Check loglevel
if config['loglevel'] == "":
# set a recognized level never used.
config['loglevel'] = 'ERROR'

View file

@ -134,7 +134,8 @@ class server_thread(threading.Thread):
self.name = name
self.queue = queue
self.server = None
self.is_running_server, self.with_gui, self.checked = [False for _ in range(3)]
self.is_running_server = False
self.checked = False
self.is_running_thread = threading.Event()
def terminate_serve(self):
@ -169,13 +170,7 @@ class server_thread(threading.Thread):
self.server.pykms_serve()
except (SystemExit, Exception) as e:
self.eject = True
if not self.with_gui:
raise
else:
if isinstance(e, SystemExit):
continue
else:
raise
raise
##---------------------------------------------------------------------------------------------------------------------------------------------------------
@ -385,9 +380,6 @@ def server_check():
opts = [('clientcount', '-c/--client-count'),
('timeoutidle', '-t0/--timeout-idle'),
('timeoutsndrcv', '-t1/--timeout-sndrcv')]
if serverthread.with_gui:
opts += [('activation', '-a/--activation-interval'),
('renewal', '-r/--renewal-interval')]
check_other(srv_config, opts, loggersrv, where = 'srv')
# Check further addresses / ports.
@ -467,7 +459,6 @@ def server_main_terminal():
server_check()
serverthread.checked = True
# (without GUI) and (without daemon).
# Run threaded server.
serverqueue.put('start')
# Wait to finish.