From af3a8b9a1edc60976a02d76c736397c8fd968083 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Wed, 2 Aug 2023 18:38:26 -0700 Subject: [PATCH] http: Reformat Signed-off-by: Alek Ratzloff --- chanbans/db.py | 3 ++- chanbans/http.py | 1 + chanbans/pull.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chanbans/db.py b/chanbans/db.py index ab35e96..99cde1a 100644 --- a/chanbans/db.py +++ b/chanbans/db.py @@ -39,6 +39,7 @@ def get_db(db_path: str = DB_PATH): ); """ ) + def dict_factory(cursor, row): d = {} for idx, col in enumerate(cursor.description): @@ -100,7 +101,7 @@ def search_db( "md5_like": f"%{md5}%", "limit": limit, "offset": limit * page, - } + }, ) return list(result.fetchall()) diff --git a/chanbans/http.py b/chanbans/http.py index 570f10d..38805a6 100644 --- a/chanbans/http.py +++ b/chanbans/http.py @@ -9,6 +9,7 @@ from jinja2 import Environment, PackageLoader, select_autoescape from . import config from .db import get_db, search_db + # 2023-07-24 - eating stirfry tonight. It's pretty bad. # 2023-07-31 - In a meeting. Hope I don't get caught diff --git a/chanbans/pull.py b/chanbans/pull.py index c12f067..f2f92cd 100644 --- a/chanbans/pull.py +++ b/chanbans/pull.py @@ -75,7 +75,7 @@ async def pull(): post["op"] = "(OP)" in str(cols["post"]) if "thumb" in post: - thumb = post['thumb'] + thumb = post["thumb"] thumb_name = Path(thumb[:2], f"{post['thumb']}s.jpg") thumb_path = Path(config.THUMBS_DIR, thumb_name) download_jobs += [get_thumb(thumb_path, post)]