Added daemon mode

This commit is contained in:
Mark Qvist 2022-05-17 13:11:04 +02:00
parent 34b377bafe
commit c6e26e7f7f
10 changed files with 46 additions and 14 deletions

View file

@ -46,7 +46,7 @@ class NomadNetworkApp:
if issubclass(e_type, KeyboardInterrupt):
sys.__excepthook__(e_type, e_value, e_traceback)
def __init__(self, configdir = None, rnsconfigdir = None):
def __init__(self, configdir = None, rnsconfigdir = None, daemon = False):
self.version = __version__
self.enable_client = False
self.enable_node = False
@ -239,6 +239,10 @@ class NomadNetworkApp:
job_thread.setDaemon(True)
job_thread.start()
# Override UI choice from config on --daemon switch
if daemon:
self.uimode = nomadnet.ui.UI_NONE
# This stderr redirect is needed to stop urwid
# from spewing KeyErrors to the console and thus,
# messing up the UI. A pull request to fix the