Use basedpyright refactor

This commit is contained in:
marc
2025-03-22 23:06:34 +01:00
parent ac54453b7f
commit 2f7c7c2429
41 changed files with 480 additions and 381 deletions

View File

@@ -1,23 +1,15 @@
from typing import Optional
from folkugat_web import data
from folkugat_web.dal.sql import Connection, get_connection
from .write import insert_tema
def create_db(con: Optional[Connection] = None):
def create_db(con: Connection | None = None):
with get_connection(con) as con:
create_temes_table(con)
# for tema in data.TEMES:
# insert_tema(tema, con)
def drop_temes_table(con: Connection):
query = "DROP TABLE IF EXISTS temes"
cur = con.cursor()
cur.execute(query)
_ = cur.execute(query)
def create_temes_table(con: Connection):
@@ -36,4 +28,4 @@ def create_temes_table(con: Connection):
)
"""
cur = con.cursor()
cur.execute(query)
_ = cur.execute(query)