feat: create config class to replace use of config file in application

This commit is contained in:
WorldTeacher
2024-10-29 16:07:30 +01:00
parent 2137799f9b
commit f3eed7486d
13 changed files with 224 additions and 111 deletions

View File

@@ -1,10 +1,8 @@
from pyzotero import zotero
from dataclasses import dataclass
from src.logic.webrequest import WebRequest, BibTextTransformer
from omegaconf import OmegaConf
from src import settings
config = OmegaConf.load("config.yaml")
config = config["zotero"]
@dataclass
@@ -160,9 +158,12 @@ class JournalArticle:
class ZoteroController:
zoterocfg = settings.zotero
def __init__(self):
self.zot = zotero.Zotero(
config["library_id"], config["library_type"], config["api_key"]
self.zoterocfg.library_id,
self.zoterocfg.library_type,
self.zoterocfg.api_key,
)
def get_books(self):