From 6018e8b59347f21294f5e26dc18ab714b32eadde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Rudowicz?= Date: Thu, 9 Oct 2025 22:34:02 +0200 Subject: [PATCH] I think library is okay now --- pages/hswro.py | 3 ++- pages/library.mu | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pages/hswro.py b/pages/hswro.py index f57fcbd..7aeb306 100755 --- a/pages/hswro.py +++ b/pages/hswro.py @@ -22,7 +22,8 @@ FORBIDDEN_INPUT = [ MENU_ITEMS = [ ("Home", "/page/index.mu]"), ("Status", "/page/status.mu"), - ("Shoutbox", "/page/chat.mu]") + ("Shoutbox", "/page/chat.mu"), + ("Library", "/page/library.mu") ] ADMIN_IDENTITIES = [ diff --git a/pages/library.mu b/pages/library.mu index 27dc975..f8360db 100755 --- a/pages/library.mu +++ b/pages/library.mu @@ -6,7 +6,7 @@ from pathlib import PurePosixPath from typing import List from os import environ -LIBRARY_DIR = "/home/reticulum/library" +LIBRARY_DIR = "/home/reticulum/.nomadnetwork/storage/files/library" library_contents = [""] @@ -23,7 +23,7 @@ with os.scandir(LIBRARY_DIR) as it: if not entry.name.startswith('.') and entry.is_file(): library_contents.append(PurePosixPath(entry.path).stem) -content_lines = ["", "Select a file to begin reading."] +content_lines = ["", "Select a file to begin reading.", "", "Some files are taken from textfiles.com"] if "var_view" in environ: document_name = environ["var_view"] @@ -39,11 +39,11 @@ page_len = max(len(library_contents), len(content_lines)) + 2 hswro.header("Library") for i in range(page_len): - menuitem = " "*23 + menuitem = " "*25 item_name = get_from_list(library_contents, i) if item_name != "": - menuitem = f" `[{item_name:<20}`:/page/library.mu`view={item_name}] " + menuitem = f"`[{item_name}`:/page/library.mu`view={item_name}] (`[DL`:/file/library/{item_name}.txt])" + " "*(max(0, 25-5-len(item_name))) content = get_from_list(content_lines, i) - print(f"{hswro.MENUBGCOLOR}{menuitem}{hswro.BGCOLOR} {content}") + print(f"{hswro.MENUBGCOLOR} {menuitem} {hswro.BGCOLOR} {content}") print("-.") hswro.footer()