mirror of
https://github.com/norohind/FDEV-CAPI-Handler.git
synced 2026-11-30 02:22:03 +03:00
Dockerized
This commit is contained in:
1 parent
e3b8c724e3
commit
f7f40738d0
9 files changed
+77
-3
No files matched your search
+1
-1
@@ -207,4 +207,4 @@ class CAPIAuthorizer:
|
||||
return self.model.list_all_records()
|
||||
|
||||
|
||||
capi_authorizer = CAPIAuthorizer(model.Model())
|
||||
capi_authorizer = CAPIAuthorizer(model.Model(config.db_location))
|
||||
+2
-2
@@ -8,8 +8,8 @@ logger = get_main_logger()
|
||||
|
||||
|
||||
class Model:
|
||||
def __init__(self):
|
||||
self.db: sqlite3.Connection = sqlite3.connect('companion-api.sqlite', check_same_thread=False)
|
||||
def __init__(self, db_location: str):
|
||||
self.db: sqlite3.Connection = sqlite3.connect(db_location, check_same_thread=False)
|
||||
self.db.row_factory = lambda c, r: dict(zip([col[0] for col in c.description], r))
|
||||
with self.db:
|
||||
self.db.execute(sqlite_requests.schema)
|
||||
|
||||
Reference in new issue
Block a user