Changed output rendering

This commit is contained in:
BlenderDumbass 2024-11-25 23:17:19 +02:00
parent 6268f6b9d2
commit a4da8a4f52
3 changed files with 29 additions and 4 deletions

View file

@ -86,12 +86,28 @@ IDColors = {}
def consoleForm(obj):
from modules.Render import accounts
# Username preview
username = ""
Accounts = accounts()
for account in Accounts:
if obj in Accounts[account].get("sessions"):
username = account
break
# Function that prints a pretty object info about
if not obj: obj = "ANONYMOUS "
if not obj: obj = " ANONYMOUS "
ID = obj
NAME = obj[-10:]
if not username:
NAME = obj[-14:]
else:
NAME = username[:15].upper()
c = IDcolor(ID)

View file

@ -1128,6 +1128,8 @@ def Graph(server, url):
article["views"]["amount"] += 1
article["views"]["viewers"].append(cookie)
server.newview = True
with open(Set.Folder()+"/tabs"+url+"/metadata.json", "w") as save:
json.dump(article, save, indent=4)

View file

@ -25,14 +25,19 @@ class handler(BaseHTTPRequestHandler):
if "?" in self.path:
self.path = self.path[:self.path.find("?")]
q = ""
q = clr["tbbl"]
b = clr["tbbl"]
if self.newview:
b = clr["bold"]+clr["tbrd"]
for i in self.parsed:
if i != "password":
q = q + "[ "+i+" : "+self.parsed[i][0]+" ] "
else:
q = q + "[ "+i+" : ******* ] "
toprint = consoleForm(self.cookie)+" "+"[ "+str(datetime.datetime.now())+" ] "+self.path+" "+q
toprint = consoleForm(self.cookie)+" "+b+"[ "+str(datetime.datetime.now())+" ] "+self.path+" "+q
print(toprint)
folder = Set.Folder()
@ -52,6 +57,8 @@ class handler(BaseHTTPRequestHandler):
self.cookie = self.headers.get("Cookie")
if self.cookie: self.cookie = self.cookie[-50:]
self.newview = False
categories = list(Render.tabs().keys())
if self.path[:self.path.find("?")] == "/" or self.path == "/":