mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-12-17 06:44:21 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2aa5c6f665 | ||
|
|
72a5ed9c8e | ||
|
|
c411ce703f | ||
|
|
c670aa82ad | ||
|
|
c52efbfb75 | ||
|
|
da348c3b42 | ||
|
|
92c3c55e03 | ||
|
|
8d9f4956db | ||
|
|
062e31964a | ||
|
|
f36018632f |
@@ -42,7 +42,14 @@ nomadnet --daemon
|
||||
nomadnet --help
|
||||
```
|
||||
|
||||
If you are using an operating system that blocks normal user package installation via `pip`, you can use the `pipx` tool to install Nomad Network instead:
|
||||
If you are using an operating system that blocks normal user package installation via `pip`, you can return `pip` to normal behaviour by editing the `~/.config/pip/pip.conf` file, and adding the following directive in the `[global]` section:
|
||||
|
||||
```text
|
||||
[global]
|
||||
break-system-packages = true
|
||||
```
|
||||
|
||||
Alternatively, you can use the `pipx` tool to install Nomad Network in an isolated environment:
|
||||
|
||||
```bash
|
||||
# Install Nomad Network
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "0.3.6"
|
||||
__version__ = "0.3.9"
|
||||
|
||||
@@ -45,6 +45,8 @@ THEMES = {
|
||||
("list_normal", "dark gray", "default", "default", "#bbb", "default"),
|
||||
("list_untrusted", "dark red", "default", "default", "#a22", "default"),
|
||||
("list_focus_untrusted", "black", "light gray", "standout", "#810", "#aaa"),
|
||||
("list_unresponsive", "yellow", "default", "default", "#b92", "default"),
|
||||
("list_focus_unresponsive", "black", "light gray", "standout", "#530", "#aaa"),
|
||||
("topic_list_normal", "light gray", "default", "default", "#ddd", "default"),
|
||||
("browser_controls", "light gray", "default", "default", "#bbb", "default"),
|
||||
("progress_full", "black", "light gray", "standout", "#111", "#bbb"),
|
||||
@@ -78,6 +80,8 @@ THEMES = {
|
||||
("list_normal", "dark gray", "default", "default", "#444", "default"),
|
||||
("list_untrusted", "dark red", "default", "default", "#a22", "default"),
|
||||
("list_focus_untrusted", "black", "dark gray", "standout", "#810", "#aaa"),
|
||||
("list_unresponsive", "yellow", "default", "default", "#b92", "default"),
|
||||
("list_focus_unresponsive", "black", "light gray", "standout", "#530", "#aaa"),
|
||||
("topic_list_normal", "dark gray", "default", "default", "#222", "default"),
|
||||
("browser_controls", "dark gray", "default", "default", "#444", "default"),
|
||||
("progress_full", "black", "dark gray", "standout", "#111", "#bbb"),
|
||||
|
||||
@@ -756,7 +756,7 @@ class Browser:
|
||||
def __load(self):
|
||||
# If an established link exists, but it doesn't match the target
|
||||
# destination, we close and clear it.
|
||||
if self.link != None and self.link.destination.hash != self.destination_hash:
|
||||
if self.link != None and (self.link.destination.hash != self.destination_hash or self.link.status != RNS.Link.ACTIVE):
|
||||
self.link.teardown()
|
||||
self.link = None
|
||||
|
||||
@@ -1005,6 +1005,11 @@ class Browser:
|
||||
self.response_transfer_size = None
|
||||
|
||||
self.update_display()
|
||||
if self.link != None:
|
||||
try:
|
||||
self.link.teardown()
|
||||
except Exception as e:
|
||||
pass
|
||||
else:
|
||||
self.status = Browser.REQUEST_FAILED
|
||||
self.response_progress = 0
|
||||
@@ -1012,6 +1017,11 @@ class Browser:
|
||||
self.response_transfer_size = None
|
||||
|
||||
self.update_display()
|
||||
if self.link != None:
|
||||
try:
|
||||
self.link.teardown()
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
|
||||
def request_timeout(self, request_receipt=None):
|
||||
@@ -1021,6 +1031,11 @@ class Browser:
|
||||
self.response_transfer_size = None
|
||||
|
||||
self.update_display()
|
||||
if self.link != None:
|
||||
try:
|
||||
self.link.teardown()
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
|
||||
def response_progressed(self, request_receipt):
|
||||
|
||||
@@ -586,7 +586,7 @@ class KnownNodeInfo(urwid.WidgetWrap):
|
||||
def ident_change(sender, userdata):
|
||||
pass
|
||||
|
||||
propagation_node_checkbox = urwid.CheckBox("Use as default propagation node", state=(self.app.get_user_selected_propagation_node() == source_hash), on_state_change=pn_change)
|
||||
propagation_node_checkbox = urwid.CheckBox("Use as default propagation node", state=(self.app.get_user_selected_propagation_node() == pn_hash), on_state_change=pn_change)
|
||||
connect_identify_checkbox = urwid.CheckBox("Identify when connecting", state=self.app.directory.should_identify_on_connect(source_hash), on_state_change=ident_change)
|
||||
|
||||
def save_node(sender):
|
||||
@@ -1576,7 +1576,11 @@ class LXMFPeers(urwid.WidgetWrap):
|
||||
self.pile = urwid.Pile([urwid.Text(("warning_text", g["info"]+"\n"), align="center"), SelectText(("warning_text", "Currently, no LXMF nodes are peered\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="LXMF Propagation Peers"), widget_style))
|
||||
if hasattr(self, "peer_list") and self.peer_list:
|
||||
pl = len(self.peer_list)
|
||||
else:
|
||||
pl = 0
|
||||
urwid.WidgetWrap.__init__(self, urwid.AttrMap(urwid.LineBox(self.display_widget, title=f"LXMF Propagation Peers ({pl})"), widget_style))
|
||||
|
||||
def keypress(self, size, key):
|
||||
if key == "up" and (self.no_content or self.ilb.first_item_is_selected()):
|
||||
@@ -1611,13 +1615,13 @@ class LXMFPeers(urwid.WidgetWrap):
|
||||
|
||||
def make_peer_widgets(self):
|
||||
widget_list = []
|
||||
for peer_id in self.peer_list:
|
||||
sorted_peers = sorted(self.peer_list, key=lambda pid: self.peer_list[pid].link_establishment_rate, reverse=True)
|
||||
for peer_id in sorted_peers:
|
||||
peer = self.peer_list[peer_id]
|
||||
pe = LXMFPeerEntry(self.app, peer, self)
|
||||
pe.destination_hash = peer.destination_hash
|
||||
widget_list.append(pe)
|
||||
|
||||
# TODO: Sort list
|
||||
return widget_list
|
||||
|
||||
class LXMFPeerEntry(urwid.WidgetWrap):
|
||||
@@ -1633,7 +1637,7 @@ class LXMFPeerEntry(urwid.WidgetWrap):
|
||||
node_hash = RNS.Destination.hash_from_name_and_identity("nomadnetwork.node", node_identity)
|
||||
display_name = self.app.directory.alleged_display_str(node_hash)
|
||||
if display_name != None:
|
||||
display_str += " "+str(display_name)
|
||||
display_str = str(display_name)+"\n "+display_str
|
||||
|
||||
sym = g["sent"]
|
||||
style = "list_unknown"
|
||||
@@ -1643,8 +1647,12 @@ class LXMFPeerEntry(urwid.WidgetWrap):
|
||||
if hasattr(peer, "alive"):
|
||||
if peer.alive:
|
||||
alive_string = "Available"
|
||||
style = "list_normal"
|
||||
focus_style = "list_focus"
|
||||
else:
|
||||
alive_string = "Unresponsive"
|
||||
style = "list_unresponsive"
|
||||
focus_style = "list_focus_unresponsive"
|
||||
|
||||
widget = ListEntry(sym+" "+display_str+"\n "+alive_string+", last heard "+pretty_date(int(peer.last_heard))+"\n "+str(len(peer.unhandled_messages))+" unhandled LXMs, "+RNS.prettysize(peer.link_establishment_rate/8, "b")+"/s LER")
|
||||
# urwid.connect_signal(widget, "click", delegate.connect_node, node)
|
||||
|
||||
2
setup.py
2
setup.py
@@ -30,6 +30,6 @@ setuptools.setup(
|
||||
entry_points= {
|
||||
'console_scripts': ['nomadnet=nomadnet.nomadnet:main']
|
||||
},
|
||||
install_requires=["rns>=0.5.7", "lxmf>=0.3.2", "urwid>=2.1.2", "qrcode"],
|
||||
install_requires=["rns>=0.6.2", "lxmf>=0.3.4", "urwid==2.1.2", "qrcode"],
|
||||
python_requires=">=3.6",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user