Move tabulate import into local functions.
This commit is contained in:
parent
9d264dcf3a
commit
6e94a0ed52
1 changed files with 7 additions and 1 deletions
|
@ -14,7 +14,6 @@ from files.helpers.math import saturate, remap, lerp
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
from tabulate import tabulate
|
|
||||||
|
|
||||||
from files.__main__ import app, db_session
|
from files.__main__ import app, db_session
|
||||||
|
|
||||||
|
@ -89,6 +88,8 @@ def _compile_records(db):
|
||||||
def dbg_commentdump(cid, records_compiled, users, user_accuracy):
|
def dbg_commentdump(cid, records_compiled, users, user_accuracy):
|
||||||
print(f"Dump for comment {cid}")
|
print(f"Dump for comment {cid}")
|
||||||
|
|
||||||
|
from tabulate import tabulate
|
||||||
|
|
||||||
dats = []
|
dats = []
|
||||||
for key, value in [(key, value) for key, value in records_compiled.items() if key[1] == cid]:
|
for key, value in [(key, value) for key, value in records_compiled.items() if key[1] == cid]:
|
||||||
uid = key[0]
|
uid = key[0]
|
||||||
|
@ -102,6 +103,8 @@ def dbg_commentdump(cid, records_compiled, users, user_accuracy):
|
||||||
def dbg_userdump(uid, records_compiled, users, comment_calculated_badness_user):
|
def dbg_userdump(uid, records_compiled, users, comment_calculated_badness_user):
|
||||||
print(f"Dump for user {users[uid]['username']}")
|
print(f"Dump for user {users[uid]['username']}")
|
||||||
|
|
||||||
|
from tabulate import tabulate
|
||||||
|
|
||||||
dats = []
|
dats = []
|
||||||
for key, value in [(key, value) for key, value in records_compiled.items() if key[0] == uid]:
|
for key, value in [(key, value) for key, value in records_compiled.items() if key[0] == uid]:
|
||||||
cid = key[1]
|
cid = key[1]
|
||||||
|
@ -305,6 +308,9 @@ def volunteer_janitor_recalc(db: Session, diagnostics: bool = False):
|
||||||
|
|
||||||
if diagnostics:
|
if diagnostics:
|
||||||
# debug print
|
# debug print
|
||||||
|
|
||||||
|
from tabulate import tabulate
|
||||||
|
|
||||||
commentscores = [{
|
commentscores = [{
|
||||||
"link": f"https://themotte.org/comment/{cid}",
|
"link": f"https://themotte.org/comment/{cid}",
|
||||||
"badness": comment_calculated_badness_admin[cid],
|
"badness": comment_calculated_badness_admin[cid],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue