Changed output rendering
This commit is contained in:
parent
6268f6b9d2
commit
a4da8a4f52
3 changed files with 29 additions and 4 deletions
|
@ -86,12 +86,28 @@ IDColors = {}
|
||||||
|
|
||||||
def consoleForm(obj):
|
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
|
# Function that prints a pretty object info about
|
||||||
|
|
||||||
if not obj: obj = " ANONYMOUS "
|
if not obj: obj = " ANONYMOUS "
|
||||||
|
|
||||||
ID = obj
|
ID = obj
|
||||||
NAME = obj[-10:]
|
|
||||||
|
if not username:
|
||||||
|
NAME = obj[-14:]
|
||||||
|
else:
|
||||||
|
NAME = username[:15].upper()
|
||||||
|
|
||||||
c = IDcolor(ID)
|
c = IDcolor(ID)
|
||||||
|
|
||||||
|
|
|
@ -1128,6 +1128,8 @@ def Graph(server, url):
|
||||||
article["views"]["amount"] += 1
|
article["views"]["amount"] += 1
|
||||||
article["views"]["viewers"].append(cookie)
|
article["views"]["viewers"].append(cookie)
|
||||||
|
|
||||||
|
server.newview = True
|
||||||
|
|
||||||
with open(Set.Folder()+"/tabs"+url+"/metadata.json", "w") as save:
|
with open(Set.Folder()+"/tabs"+url+"/metadata.json", "w") as save:
|
||||||
json.dump(article, save, indent=4)
|
json.dump(article, save, indent=4)
|
||||||
|
|
||||||
|
|
|
@ -25,14 +25,19 @@ class handler(BaseHTTPRequestHandler):
|
||||||
if "?" in self.path:
|
if "?" in self.path:
|
||||||
self.path = self.path[:self.path.find("?")]
|
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:
|
for i in self.parsed:
|
||||||
if i != "password":
|
if i != "password":
|
||||||
q = q + "[ "+i+" : "+self.parsed[i][0]+" ] "
|
q = q + "[ "+i+" : "+self.parsed[i][0]+" ] "
|
||||||
else:
|
else:
|
||||||
q = q + "[ "+i+" : ******* ] "
|
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)
|
print(toprint)
|
||||||
|
|
||||||
folder = Set.Folder()
|
folder = Set.Folder()
|
||||||
|
@ -52,6 +57,8 @@ class handler(BaseHTTPRequestHandler):
|
||||||
self.cookie = self.headers.get("Cookie")
|
self.cookie = self.headers.get("Cookie")
|
||||||
if self.cookie: self.cookie = self.cookie[-50:]
|
if self.cookie: self.cookie = self.cookie[-50:]
|
||||||
|
|
||||||
|
self.newview = False
|
||||||
|
|
||||||
categories = list(Render.tabs().keys())
|
categories = list(Render.tabs().keys())
|
||||||
|
|
||||||
if self.path[:self.path.find("?")] == "/" or self.path == "/":
|
if self.path[:self.path.find("?")] == "/" or self.path == "/":
|
||||||
|
|
Loading…
Add table
Reference in a new issue