forked from MarseyWorld/MarseyWorld
cxzzcx
parent
2c37df1d1f
commit
0b93902c2b
|
@ -26,7 +26,7 @@ class Badge(Base):
|
|||
@lazy
|
||||
def badge(self):
|
||||
with open("badges.json", 'r') as f:
|
||||
return loads(f.read())[str(self.badge_id)]
|
||||
return loads(f.read().replace("'",'"'))[str(self.badge_id)]
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -178,7 +178,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
sanitized = re.sub('\|\|(.*?)\|\|', r'<span class="spoiler">\1</span>', sanitized)
|
||||
|
||||
if comment:
|
||||
with open("marseys.json", 'r') as f: marsey_count = loads(f.read())
|
||||
with open("marseys.json", 'r') as f: marsey_count = loads(f.read().replace("'",'"'))
|
||||
marseys_used = set()
|
||||
|
||||
emojis = list(re.finditer("[^a]>\s*(:[!#]{0,2}\w+:\s*)+<\/", sanitized))
|
||||
|
|
|
@ -424,7 +424,7 @@ def under_attack(v):
|
|||
@app.get("/admin/badge_grant")
|
||||
@admin_level_required(2)
|
||||
def badge_grant_get(v):
|
||||
with open("badges.json", 'r') as f: BADGES = loads(f.read())
|
||||
with open("badges.json", 'r') as f: BADGES = loads(f.read().replace("'",'"'))
|
||||
return render_template("admin/badge_grant.html", v=v, badge_types=BADGES)
|
||||
|
||||
|
||||
|
@ -432,7 +432,7 @@ def badge_grant_get(v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@admin_level_required(2)
|
||||
def badge_grant_post(v):
|
||||
with open("badges.json", 'r') as f: BADGES = loads(f.read())
|
||||
with open("badges.json", 'r') as f: BADGES = loads(f.read().replace("'",'"'))
|
||||
|
||||
user = get_user(request.values.get("username").strip(), graceful=True)
|
||||
if not user:
|
||||
|
@ -466,7 +466,7 @@ def badge_grant_post(v):
|
|||
@app.get("/admin/badge_remove")
|
||||
@admin_level_required(2)
|
||||
def badge_remove_get(v):
|
||||
with open("badges.json", 'r') as f: BADGES = loads(f.read())
|
||||
with open("badges.json", 'r') as f: BADGES = loads(f.read().replace("'",'"'))
|
||||
|
||||
return render_template("admin/badge_remove.html", v=v, badge_types=BADGES)
|
||||
|
||||
|
@ -475,7 +475,7 @@ def badge_remove_get(v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@admin_level_required(2)
|
||||
def badge_remove_post(v):
|
||||
with open("badges.json", 'r') as f: BADGES = loads(f.read())
|
||||
with open("badges.json", 'r') as f: BADGES = loads(f.read().replace("'",'"'))
|
||||
|
||||
user = get_user(request.values.get("username").strip(), graceful=True)
|
||||
if not user:
|
||||
|
|
|
@ -163,7 +163,7 @@ def api_comment(v):
|
|||
try: badge_body = loads(body.lower())
|
||||
except: return {"error": "You didn't follow the format retard"}, 500
|
||||
badge_number = str(len(listdir('files/assets/images/badges'))+1)
|
||||
with open("badges.json", 'r') as f: badges = loads(f.read())
|
||||
with open("badges.json", 'r') as f: badges = loads(f.read().replace("'",'"'))
|
||||
badges[badge_number] = badge_body
|
||||
elif v.id in (CARP_ID,AEVANN_ID) and parent_post.id == 37838:
|
||||
try:
|
||||
|
@ -172,7 +172,7 @@ def api_comment(v):
|
|||
marsey_body = marsey_dict[0][1]
|
||||
marsey_body["count"] = 0
|
||||
except: return {"error": "You didn't follow the format retard"}, 400
|
||||
with open("marseys.json", 'r') as f: marseys = loads(f.read())
|
||||
with open("marseys.json", 'r') as f: marseys = loads(f.read().replace("'",'"'))
|
||||
marseys[marsey_key] = marsey_body
|
||||
|
||||
if v.marseyawarded:
|
||||
|
|
|
@ -1008,7 +1008,7 @@ def submit_post(v):
|
|||
with open(f'snappy_{SITE_NAME}.txt', "r") as f:
|
||||
snappyquotes = f.read().split("{[para]}")
|
||||
if request.host != 'pcmemes.net':
|
||||
with open("marseys.json", 'r') as f: marseys = loads(f.read()).keys()
|
||||
with open("marseys.json", 'r') as f: marseys = loads(f.read().replace("'",'"')).keys()
|
||||
snappyquotes += [f':#{x}:' for x in marseys]
|
||||
body = random.choice(snappyquotes)
|
||||
body += "\n\n"
|
||||
|
|
|
@ -17,7 +17,7 @@ def privacy(v):
|
|||
@app.get("/marseys")
|
||||
@auth_required
|
||||
def marseys(v):
|
||||
with open("marseys.json", 'r') as f: marsey_count = list(loads(f.read()).items())
|
||||
with open("marseys.json", 'r') as f: marsey_count = list(loads(f.read().replace("'",'"')).items())
|
||||
marsey_count = sorted(marsey_count, key=lambda x: list(x[1].values())[2], reverse=True)
|
||||
return render_template("marseys.html", v=v, marseys=marsey_count)
|
||||
|
||||
|
@ -48,7 +48,7 @@ def participation_stats(v):
|
|||
|
||||
day = now - 86400
|
||||
|
||||
with open("marseys.json", 'r') as f: marseys = loads(f.read())
|
||||
with open("marseys.json", 'r') as f: marseys = loads(f.read().replace("'",'"'))
|
||||
|
||||
data = {"marseys": len(marseys),
|
||||
"users": g.db.query(User.id).count(),
|
||||
|
@ -366,14 +366,14 @@ def settings_profile(v):
|
|||
@app.get("/badges")
|
||||
@auth_required
|
||||
def badges(v):
|
||||
with open("badges.json", 'r') as f: BADGES = loads(f.read())
|
||||
with open("badges.json", 'r') as f: BADGES = loads(f.read().replace("'",'"'))
|
||||
|
||||
return render_template("badges.html", v=v, badges=BADGES)
|
||||
|
||||
@app.get("/marsey_list")
|
||||
@auth_required
|
||||
def marsey_list(v):
|
||||
with open("marseys.json", 'r') as f: return loads(f.read())
|
||||
with open("marseys.json", 'r') as f: return loads(f.read().replace("'",'"'))
|
||||
|
||||
@app.get("/blocks")
|
||||
@auth_required
|
||||
|
|
|
@ -31,7 +31,7 @@ def leaderboard_thread():
|
|||
|
||||
if SITE_NAME == 'Drama':
|
||||
users13 = {}
|
||||
with open("marseys.json", 'r') as f: authors = (x for x in loads(f.read()).values())
|
||||
with open("marseys.json", 'r') as f: authors = (x for x in loads(f.read().replace("'",'"')).values())
|
||||
for x in authors:
|
||||
if x["author"] in users13: users13[x["author"]] += 1
|
||||
else: users13[x["author"]] = 1
|
||||
|
|
Loading…
Reference in New Issue