feat: create config class to replace use of config file in application
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user