remotes/1693045480750635534/spooky-22
Aevann1 2022-01-12 04:07:11 +02:00
parent 1ed3410bee
commit 2cbee62e13
2 changed files with 21 additions and 12 deletions

View File

@ -752,7 +752,6 @@ NOTIFIED_USERS = {
'joan': JOAN_ID, 'joan': JOAN_ID,
'pewkie': JOAN_ID, 'pewkie': JOAN_ID,
'carp': CARP_ID, 'carp': CARP_ID,
'carp': DONGER_ID,
'idio3': IDIO_ID, 'idio3': IDIO_ID,
'idio ': IDIO_ID, 'idio ': IDIO_ID,
'landlord_messiah': LLM_ID, 'landlord_messiah': LLM_ID,

View File

@ -1,5 +1,5 @@
from files.mail import * from files.mail import *
from files.__main__ import app, limiter, mail from files.__main__ import app, limiter, mail, db_session
from files.helpers.alerts import * from files.helpers.alerts import *
from files.helpers.const import * from files.helpers.const import *
from files.classes.award import AWARDS from files.classes.award import AWARDS
@ -8,10 +8,28 @@ from os import path
import calendar import calendar
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from files.classes.mod_logs import ACTIONTYPES, ACTIONTYPES2 from files.classes.mod_logs import ACTIONTYPES, ACTIONTYPES2
import gevent
site = environ.get("DOMAIN").strip() site = environ.get("DOMAIN").strip()
site_name = environ.get("SITE_NAME").strip() site_name = environ.get("SITE_NAME").strip()
def counter():
print('fuc', flush=True)
print(marseys.items(), flush=True)
db = db_session()
sorted_marseys = []
index = 0
for k, val in marseys.items():
count = db.query(Comment.id).where(Comment.body.like(f'%:{k}:%')).count()
sorted_marseys.append((k, val, count))
index += 1
print(f'{index}- {k}: {count}', flush=True)
db.close()
sorted_marseys = sorted(sorted_marseys, key=lambda x: x[2], reverse=True)
text = render_template("marseys.html", marseys=sorted_marseys)
with open(f'files/templates/marseys.html', 'w+') as f: f.write(text)
@app.get("/privacy") @app.get("/privacy")
@auth_required @auth_required
def privacy(v): def privacy(v):
@ -20,16 +38,8 @@ def privacy(v):
@app.get("/marseys") @app.get("/marseys")
@admin_level_required(3) @admin_level_required(3)
def emojis(v): def emojis(v):
sorted_marseys = [] if v.username == 'Aevann': gevent.spawn(counter)
for k, val in marseys.items(): return 'sex'
count = g.db.query(Comment.id).where(Comment.body.like(f'%:{k}:%')).count()
sorted_marseys.append((k, val, count))
sorted_marseys = sorted(sorted_marseys, key=lambda x: x[2])
text = render_template("marseys.html", v=v, marseys=sorted_marseys)
with open(f'files/templates/marseys.html', 'w+') as f: f.write(text)
return text
@app.get("/terms") @app.get("/terms")
@auth_required @auth_required