mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-12-17 23:04:24 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c52efbfb75 | ||
|
|
da348c3b42 | ||
|
|
92c3c55e03 | ||
|
|
8d9f4956db | ||
|
|
062e31964a | ||
|
|
f36018632f |
@@ -42,7 +42,14 @@ nomadnet --daemon
|
|||||||
nomadnet --help
|
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
|
```bash
|
||||||
# Install Nomad Network
|
# Install Nomad Network
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = "0.3.6"
|
__version__ = "0.3.8"
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ THEMES = {
|
|||||||
("list_normal", "dark gray", "default", "default", "#bbb", "default"),
|
("list_normal", "dark gray", "default", "default", "#bbb", "default"),
|
||||||
("list_untrusted", "dark red", "default", "default", "#a22", "default"),
|
("list_untrusted", "dark red", "default", "default", "#a22", "default"),
|
||||||
("list_focus_untrusted", "black", "light gray", "standout", "#810", "#aaa"),
|
("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"),
|
("topic_list_normal", "light gray", "default", "default", "#ddd", "default"),
|
||||||
("browser_controls", "light gray", "default", "default", "#bbb", "default"),
|
("browser_controls", "light gray", "default", "default", "#bbb", "default"),
|
||||||
("progress_full", "black", "light gray", "standout", "#111", "#bbb"),
|
("progress_full", "black", "light gray", "standout", "#111", "#bbb"),
|
||||||
@@ -78,6 +80,8 @@ THEMES = {
|
|||||||
("list_normal", "dark gray", "default", "default", "#444", "default"),
|
("list_normal", "dark gray", "default", "default", "#444", "default"),
|
||||||
("list_untrusted", "dark red", "default", "default", "#a22", "default"),
|
("list_untrusted", "dark red", "default", "default", "#a22", "default"),
|
||||||
("list_focus_untrusted", "black", "dark gray", "standout", "#810", "#aaa"),
|
("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"),
|
("topic_list_normal", "dark gray", "default", "default", "#222", "default"),
|
||||||
("browser_controls", "dark gray", "default", "default", "#444", "default"),
|
("browser_controls", "dark gray", "default", "default", "#444", "default"),
|
||||||
("progress_full", "black", "dark gray", "standout", "#111", "#bbb"),
|
("progress_full", "black", "dark gray", "standout", "#111", "#bbb"),
|
||||||
|
|||||||
@@ -756,7 +756,7 @@ class Browser:
|
|||||||
def __load(self):
|
def __load(self):
|
||||||
# If an established link exists, but it doesn't match the target
|
# If an established link exists, but it doesn't match the target
|
||||||
# destination, we close and clear it.
|
# 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.teardown()
|
||||||
self.link = None
|
self.link = None
|
||||||
|
|
||||||
@@ -1005,6 +1005,11 @@ class Browser:
|
|||||||
self.response_transfer_size = None
|
self.response_transfer_size = None
|
||||||
|
|
||||||
self.update_display()
|
self.update_display()
|
||||||
|
if self.link != None:
|
||||||
|
try:
|
||||||
|
self.link.teardown()
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
self.status = Browser.REQUEST_FAILED
|
self.status = Browser.REQUEST_FAILED
|
||||||
self.response_progress = 0
|
self.response_progress = 0
|
||||||
@@ -1012,6 +1017,11 @@ class Browser:
|
|||||||
self.response_transfer_size = None
|
self.response_transfer_size = None
|
||||||
|
|
||||||
self.update_display()
|
self.update_display()
|
||||||
|
if self.link != None:
|
||||||
|
try:
|
||||||
|
self.link.teardown()
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def request_timeout(self, request_receipt=None):
|
def request_timeout(self, request_receipt=None):
|
||||||
@@ -1021,6 +1031,11 @@ class Browser:
|
|||||||
self.response_transfer_size = None
|
self.response_transfer_size = None
|
||||||
|
|
||||||
self.update_display()
|
self.update_display()
|
||||||
|
if self.link != None:
|
||||||
|
try:
|
||||||
|
self.link.teardown()
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def response_progressed(self, request_receipt):
|
def response_progressed(self, request_receipt):
|
||||||
|
|||||||
@@ -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.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")
|
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):
|
def keypress(self, size, key):
|
||||||
if key == "up" and (self.no_content or self.ilb.first_item_is_selected()):
|
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):
|
def make_peer_widgets(self):
|
||||||
widget_list = []
|
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]
|
peer = self.peer_list[peer_id]
|
||||||
pe = LXMFPeerEntry(self.app, peer, self)
|
pe = LXMFPeerEntry(self.app, peer, self)
|
||||||
pe.destination_hash = peer.destination_hash
|
pe.destination_hash = peer.destination_hash
|
||||||
widget_list.append(pe)
|
widget_list.append(pe)
|
||||||
|
|
||||||
# TODO: Sort list
|
|
||||||
return widget_list
|
return widget_list
|
||||||
|
|
||||||
class LXMFPeerEntry(urwid.WidgetWrap):
|
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)
|
node_hash = RNS.Destination.hash_from_name_and_identity("nomadnetwork.node", node_identity)
|
||||||
display_name = self.app.directory.alleged_display_str(node_hash)
|
display_name = self.app.directory.alleged_display_str(node_hash)
|
||||||
if display_name != None:
|
if display_name != None:
|
||||||
display_str += " "+str(display_name)
|
display_str = str(display_name)+"\n "+display_str
|
||||||
|
|
||||||
sym = g["sent"]
|
sym = g["sent"]
|
||||||
style = "list_unknown"
|
style = "list_unknown"
|
||||||
@@ -1643,8 +1647,12 @@ class LXMFPeerEntry(urwid.WidgetWrap):
|
|||||||
if hasattr(peer, "alive"):
|
if hasattr(peer, "alive"):
|
||||||
if peer.alive:
|
if peer.alive:
|
||||||
alive_string = "Available"
|
alive_string = "Available"
|
||||||
|
style = "list_normal"
|
||||||
|
focus_style = "list_focus"
|
||||||
else:
|
else:
|
||||||
alive_string = "Unresponsive"
|
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")
|
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)
|
# urwid.connect_signal(widget, "click", delegate.connect_node, node)
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -30,6 +30,6 @@ setuptools.setup(
|
|||||||
entry_points= {
|
entry_points= {
|
||||||
'console_scripts': ['nomadnet=nomadnet.nomadnet:main']
|
'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.5.9", "lxmf>=0.3.3", "urwid==2.1.2", "qrcode"],
|
||||||
python_requires=">=3.6",
|
python_requires=">=3.6",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user