Compare commits

...

13 Commits
0.9.0 ... 0.9.2

Author SHA1 Message Date
Mark Qvist
c9ca0a2fd1 Updated version 2025-12-22 13:09:17 +01:00
Mark Qvist
cb87148ec3 Updated dependencies 2025-12-22 13:08:39 +01:00
markqvist
9596361a6b Merge pull request #87 from strijar/pyc_fix
Fixed work from compiled pyc files
2025-12-22 12:54:04 +01:00
Mark Qvist
d4a3a91e04 Updated micron text aligment parsing. Fixes #83. 2025-12-22 12:51:31 +01:00
Mark Qvist
dbd1d87adb Fixed micron fg/bg color header parsing. 2025-12-22 12:42:32 +01:00
Mark Qvist
db3642ee05 Parse intro_time as float. Fixes #79. 2025-12-22 11:41:59 +01:00
Mark Qvist
6b74e49b0f Merge branch 'master' of github.com:markqvist/NomadNet 2025-12-22 11:27:33 +01:00
Mark Qvist
5253cccfa7 Save peer settings file using write-then-copy 2025-12-22 11:27:05 +01:00
Mark Qvist
a2e6a06a35 Added warning and explanation on corrupt peer settings file 2025-12-22 11:18:21 +01:00
Belousov Oleg
9c79496504 Fixed work from compiled pyc files 2025-12-19 23:50:02 +03:00
markqvist
eafe77718f Merge pull request #85 from RFnexus/master
Strip whitespace from LXMF address and URL dialog
2025-12-13 13:56:50 +01:00
Zenith
6d2bf21f0d Strip whitespace from LXMF address and URL dialog 2025-12-12 19:21:03 -05:00
Mark Qvist
eac9021c75 Updated required LXMF to 0.9.1 2025-11-03 22:31:34 +01:00
10 changed files with 45 additions and 40 deletions

View File

@@ -245,8 +245,11 @@ class NomadNetworkApp:
self.peer_settings["served_file_requests"] = 0
except Exception as e:
RNS.log("Could not load local peer settings from "+self.peersettingspath, RNS.LOG_ERROR)
RNS.log("The contained exception was: %s" % (str(e)), RNS.LOG_ERROR)
RNS.logdest = RNS.LOG_STDOUT
RNS.log(f"Could not load local peer settings from {self.peersettingspath}", RNS.LOG_ERROR)
RNS.log(f"The contained exception was: {e}", RNS.LOG_ERROR)
RNS.log(f"This likely means that the peer settings file has become corrupt.", RNS.LOG_ERROR)
RNS.log(f"You can try deleting the file at {self.peersettingspath} and restarting nomadnet.", RNS.LOG_ERROR)
nomadnet.panic()
else:
try:
@@ -558,9 +561,9 @@ class NomadNetworkApp:
return self.message_router.get_outbound_propagation_node()
def save_peer_settings(self):
file = open(self.peersettingspath, "wb")
file.write(msgpack.packb(self.peer_settings))
file.close()
tmp_path = f"{self.peersettingspath}.tmp"
with open(tmp_path, "wb") as file: file.write(msgpack.packb(self.peer_settings))
os.replace(tmp_path, self.peersettingspath)
def lxmf_delivery(self, message):
time_string = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(message.timestamp))
@@ -805,7 +808,7 @@ class NomadNetworkApp:
if not "intro_time" in self.config["textui"]:
self.config["textui"]["intro_time"] = 1
else:
self.config["textui"]["intro_time"] = self.config["textui"].as_int("intro_time")
self.config["textui"]["intro_time"] = self.config["textui"].as_float("intro_time")
if not "intro_text" in self.config["textui"]:
self.config["textui"]["intro_text"] = "Nomad Network"

View File

@@ -8,8 +8,10 @@ from .Node import Node
from .ui import *
modules = glob.glob(os.path.dirname(__file__)+"/*.py")
__all__ = [ os.path.basename(f)[:-3] for f in modules if not f.endswith('__init__.py')]
py_modules = glob.glob(os.path.dirname(__file__)+"/*.py")
pyc_modules = glob.glob(os.path.dirname(__file__)+"/*.pyc")
modules = py_modules+pyc_modules
__all__ = list(set([os.path.basename(f).replace(".pyc", "").replace(".py", "") for f in modules if not (f.endswith("__init__.py") or f.endswith("__init__.pyc"))]))
def panic():
os._exit(255)

View File

@@ -1 +1 @@
__version__ = "0.9.0"
__version__ = "0.9.2"

View File

@@ -3,8 +3,10 @@ import glob
import RNS
import nomadnet
modules = glob.glob(os.path.dirname(__file__)+"/*.py")
__all__ = [ os.path.basename(f)[:-3] for f in modules if not f.endswith('__init__.py')]
py_modules = glob.glob(os.path.dirname(__file__)+"/*.py")
pyc_modules = glob.glob(os.path.dirname(__file__)+"/*.pyc")
modules = py_modules+pyc_modules
__all__ = list(set([os.path.basename(f).replace(".pyc", "").replace(".py", "") for f in modules if not (f.endswith("__init__.py") or f.endswith("__init__.pyc"))]))
UI_NONE = 0x00

View File

@@ -697,7 +697,7 @@ class Browser:
def confirmed(sender):
try:
self.retrieve_url(e_url.get_edit_text())
self.retrieve_url(e_url.get_edit_text().strip())
except Exception as e:
self.browser_footer = urwid.Text("Could not open link: "+str(e))
self.frame.contents["footer"] = (self.browser_footer, self.frame.options())
@@ -799,7 +799,7 @@ class Browser:
self.page_background_color = None
bgpos = self.markup.find("#!bg=")
if bgpos:
if bgpos >= 0:
endpos = self.markup.find("\n", bgpos)
if endpos-(bgpos+5) == 3:
bg = self.markup[bgpos+5:endpos]
@@ -807,7 +807,7 @@ class Browser:
self.page_foreground_color = None
fgpos = self.markup.find("#!fg=")
if fgpos:
if fgpos >= 0:
endpos = self.markup.find("\n", fgpos)
if endpos-(fgpos+5) == 3:
fg = self.markup[fgpos+5:endpos]
@@ -866,7 +866,7 @@ class Browser:
self.page_background_color = None
bgpos = self.markup.find("#!bg=")
if bgpos:
if bgpos >= 0:
endpos = self.markup.find("\n", bgpos)
if endpos-(bgpos+5) == 3:
bg = self.markup[bgpos+5:endpos]
@@ -874,7 +874,7 @@ class Browser:
self.page_foreground_color = None
fgpos = self.markup.find("#!fg=")
if fgpos:
if fgpos >= 0:
endpos = self.markup.find("\n", fgpos)
if endpos-(fgpos+5) == 3:
fg = self.markup[fgpos+5:endpos]
@@ -1018,7 +1018,7 @@ class Browser:
self.page_background_color = None
bgpos = self.markup.find("#!bg=")
if bgpos:
if bgpos >= 0:
endpos = self.markup.find("\n", bgpos)
if endpos-(bgpos+5) == 3:
bg = self.markup[bgpos+5:endpos]
@@ -1026,7 +1026,7 @@ class Browser:
self.page_foreground_color = None
fgpos = self.markup.find("#!fg=")
if fgpos:
if fgpos >= 0:
endpos = self.markup.find("\n", fgpos)
if endpos-(fgpos+5) == 3:
fg = self.markup[fgpos+5:endpos]

View File

@@ -331,7 +331,7 @@ class ConversationsDisplay():
existing_conversations = nomadnet.Conversation.conversation_list(self.app)
display_name = e_name.get_edit_text()
source_hash_text = e_id.get_edit_text()
source_hash_text = e_id.get_edit_text().strip()
source_hash = bytes.fromhex(source_hash_text)
trust_level = DirectoryEntry.UNTRUSTED
if r_unknown.state == True:
@@ -412,7 +412,7 @@ class ConversationsDisplay():
try:
local_delivery_signal = "local_delivery_occurred"
duplicate_signal = "duplicate_lxm"
lxm_uri = e_uri.get_edit_text()
lxm_uri = e_uri.get_edit_text().strip()
ingest_result = self.app.message_router.ingest_lxm_uri(
lxm_uri,

View File

@@ -487,20 +487,14 @@ def make_output(state, line, url_delegate, pre_escape=False):
state["bg_color"] = state["default_bg"]
state["align"] = state["default_align"]
elif c == "c":
if state["align"] != "center":
state["align"] = "center"
else:
state["align"] = state["default_align"]
if state["align"] != "center": state["align"] = "center"
# else: state["align"] = state["default_align"]
elif c == "l":
if state["align"] != "left":
state["align"] = "left"
else:
state["align"] = state["default_align"]
if state["align"] != "left": state["align"] = "left"
# else: state["align"] = state["default_align"]
elif c == "r":
if state["align"] != "right":
state["align"] = "right"
else:
state["align"] = state["default_align"]
if state["align"] != "right": state["align"] = "right"
# else: state["align"] = state["default_align"]
elif c == "a":
state["align"] = state["default_align"]
@@ -649,7 +643,7 @@ def make_output(state, line, url_delegate, pre_escape=False):
orig_spec = speclist[4]
if url_delegate != None:
linkspec = LinkSpec(link_url, orig_spec)
linkspec = LinkSpec(link_url, orig_spec, cm=cm)
if link_fields != "":
lf = link_fields.split("|")
if len(lf) > 0:
@@ -696,11 +690,11 @@ def make_output(state, line, url_delegate, pre_escape=False):
class LinkSpec(urwid.AttrSpec):
def __init__(self, link_target, orig_spec):
def __init__(self, link_target, orig_spec, cm=256):
self.link_target = link_target
self.link_fields = None
super().__init__(orig_spec.foreground, orig_spec.background)
super().__init__(orig_spec.foreground, orig_spec.background, colors=cm)
class LinkableText(urwid.Text):

View File

@@ -1,5 +1,7 @@
import os
import glob
modules = glob.glob(os.path.dirname(__file__)+"/*.py")
__all__ = [ os.path.basename(f)[:-3] for f in modules if not f.endswith('__init__.py')]
py_modules = glob.glob(os.path.dirname(__file__)+"/*.py")
pyc_modules = glob.glob(os.path.dirname(__file__)+"/*.pyc")
modules = py_modules+pyc_modules
__all__ = list(set([os.path.basename(f).replace(".pyc", "").replace(".py", "") for f in modules if not (f.endswith("__init__.py") or f.endswith("__init__.pyc"))]))

View File

@@ -1,5 +1,7 @@
import os
import glob
modules = glob.glob(os.path.dirname(__file__)+"/*.py")
__all__ = [ os.path.basename(f)[:-3] for f in modules if not f.endswith('__init__.py')]
py_modules = glob.glob(os.path.dirname(__file__)+"/*.py")
pyc_modules = glob.glob(os.path.dirname(__file__)+"/*.pyc")
modules = py_modules+pyc_modules
__all__ = list(set([os.path.basename(f).replace(".pyc", "").replace(".py", "") for f in modules if not (f.endswith("__init__.py") or f.endswith("__init__.pyc"))]))

View File

@@ -30,6 +30,6 @@ setuptools.setup(
entry_points= {
'console_scripts': ['nomadnet=nomadnet.nomadnet:main']
},
install_requires=["rns>=1.0.1", "lxmf>=0.9.0", "urwid>=2.6.16", "qrcode"],
install_requires=["rns>=1.0.4", "lxmf>=0.9.3", "urwid>=2.6.16", "qrcode"],
python_requires=">=3.7",
)