Compare commits
2 Commits
6b67bd9d7b
...
6018e8b593
| Author | SHA1 | Date |
|---|---|---|
|
|
6018e8b593 | |
|
|
a921346dbb |
|
|
@ -37,6 +37,7 @@ if msg_to_del is not None and hswro.is_admin():
|
||||||
r.lrem(CHAT_NAME, 0, msg)
|
r.lrem(CHAT_NAME, 0, msg)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
print("#!c=0")
|
||||||
hswro.header("Shoutbox")
|
hswro.header("Shoutbox")
|
||||||
if toast is not None:
|
if toast is not None:
|
||||||
print(f"`c{toast}")
|
print(f"`c{toast}")
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ FORBIDDEN_INPUT = [
|
||||||
MENU_ITEMS = [
|
MENU_ITEMS = [
|
||||||
("Home", "/page/index.mu]"),
|
("Home", "/page/index.mu]"),
|
||||||
("Status", "/page/status.mu"),
|
("Status", "/page/status.mu"),
|
||||||
("Shoutbox", "/page/chat.mu]")
|
("Shoutbox", "/page/chat.mu"),
|
||||||
|
("Library", "/page/library.mu")
|
||||||
]
|
]
|
||||||
|
|
||||||
ADMIN_IDENTITIES = [
|
ADMIN_IDENTITIES = [
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from pathlib import PurePosixPath
|
||||||
from typing import List
|
from typing import List
|
||||||
from os import environ
|
from os import environ
|
||||||
|
|
||||||
LIBRARY_DIR = "/home/reticulum/library"
|
LIBRARY_DIR = "/home/reticulum/.nomadnetwork/storage/files/library"
|
||||||
|
|
||||||
library_contents = [""]
|
library_contents = [""]
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@ with os.scandir(LIBRARY_DIR) as it:
|
||||||
if not entry.name.startswith('.') and entry.is_file():
|
if not entry.name.startswith('.') and entry.is_file():
|
||||||
library_contents.append(PurePosixPath(entry.path).stem)
|
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:
|
if "var_view" in environ:
|
||||||
document_name = environ["var_view"]
|
document_name = environ["var_view"]
|
||||||
|
|
@ -39,10 +39,10 @@ page_len = max(len(library_contents), len(content_lines)) + 2
|
||||||
|
|
||||||
hswro.header("Library")
|
hswro.header("Library")
|
||||||
for i in range(page_len):
|
for i in range(page_len):
|
||||||
menuitem = " "*23
|
menuitem = " "*25
|
||||||
item_name = get_from_list(library_contents, i)
|
item_name = get_from_list(library_contents, i)
|
||||||
if item_name != "":
|
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)
|
content = get_from_list(content_lines, i)
|
||||||
print(f"{hswro.MENUBGCOLOR} {menuitem} {hswro.BGCOLOR} {content}")
|
print(f"{hswro.MENUBGCOLOR} {menuitem} {hswro.BGCOLOR} {content}")
|
||||||
print("-.")
|
print("-.")
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ l = hswro.get_login_info()
|
||||||
form_login = environ.get('field_username', None)
|
form_login = environ.get('field_username', None)
|
||||||
form_pass = environ.get('field_pass', None)
|
form_pass = environ.get('field_pass', None)
|
||||||
|
|
||||||
|
print("#!c=0")
|
||||||
hswro.header()
|
hswro.header()
|
||||||
if l[1] is not None:
|
if l[1] is not None:
|
||||||
print(f"`c`!Warning:`! {l[1]}")
|
print(f"`c`!Warning:`! {l[1]}")
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ from os import environ
|
||||||
|
|
||||||
hswro.logout()
|
hswro.logout()
|
||||||
|
|
||||||
|
print("#!c=0")
|
||||||
hswro.header()
|
hswro.header()
|
||||||
print("`cYou have been logged out.")
|
print("`cYou have been logged out.")
|
||||||
hswro.footer()
|
hswro.footer()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue