From a8d337a94ef393a34d6bf2cabe62824423bdeea4 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 1 Feb 2023 15:39:45 +0100 Subject: [PATCH] Fixed propagation node autoselection not working when None value was set in settings dict --- nomadnet/NomadNetworkApp.py | 11 ++++------- nomadnet/ui/textui/Network.py | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/nomadnet/NomadNetworkApp.py b/nomadnet/NomadNetworkApp.py index 1211e32..701869b 100644 --- a/nomadnet/NomadNetworkApp.py +++ b/nomadnet/NomadNetworkApp.py @@ -456,9 +456,8 @@ class NomadNetworkApp: def autoselect_propagation_node(self): selected_node = None - if "propagation_node" in self.peer_settings: + if "propagation_node" in self.peer_settings and self.peer_settings["propagation_node"] != None: selected_node = self.peer_settings["propagation_node"] - else: nodes = self.directory.known_nodes() trusted_nodes = [] @@ -706,7 +705,7 @@ class NomadNetworkApp: self.config["textui"]["intro_text"] = "Nomad Network" if not "editor" in self.config["textui"]: - self.config["textui"]["editor"] = "editor" + self.config["textui"]["editor"] = "nano" if not "glyphs" in self.config["textui"]: self.config["textui"]["glyphs"] = "unicode" @@ -958,10 +957,8 @@ glyphs = unicode # application. On by default. mouse_enabled = True -# What editor to use for editing text. By -# default the operating systems "editor" -# alias will be used. -editor = editor +# What editor to use for editing text. +editor = nano # If you don't want the Guide section to # show up in the menu, you can disable it. diff --git a/nomadnet/ui/textui/Network.py b/nomadnet/ui/textui/Network.py index 7a8081b..633fb2d 100644 --- a/nomadnet/ui/textui/Network.py +++ b/nomadnet/ui/textui/Network.py @@ -704,7 +704,7 @@ class KnownNodes(urwid.WidgetWrap): else: self.no_content = True widget_style = "inactive_text" - self.pile = urwid.Pile([urwid.Text(("warning_text", g["info"]+"\n"), align="center"), SelectText(("warning_text", "Currently, no nodes are known\n\n"), align="center")]) + self.pile = urwid.Pile([urwid.Text(("warning_text", g["info"]+"\n"), align="center"), SelectText(("warning_text", "Currently, no nodes are saved\n\nCtrl+L to view the announce stream\n\n"), align="center")]) self.display_widget = urwid.Filler(self.pile, valign="top", height="pack") urwid.WidgetWrap.__init__(self, urwid.AttrMap(urwid.LineBox(self.display_widget, title="Saved Nodes"), widget_style))