bump python version, ruff check
This commit is contained in:
@@ -48,8 +48,8 @@ class Catalogue:
|
||||
log.info(f"Searching for term: {searchterm}")
|
||||
|
||||
links = self.get_book_links(searchterm)
|
||||
# debug: links
|
||||
# print(links)
|
||||
# debug: links
|
||||
# print(links)
|
||||
for elink in links:
|
||||
result = self.search(elink)
|
||||
# in result search for class col-xs-12 rds-dl RDS_LOCATION
|
||||
@@ -167,16 +167,16 @@ class Catalogue:
|
||||
# based on PPN, get title, people, edition, year, language, pages, isbn,
|
||||
link = f"https://rds.ibs-bw.de/phfreiburg/opac/RDSIndexrecord/{ppn}"
|
||||
result = self.search(link)
|
||||
soup = BeautifulSoup(result, "html.parser")
|
||||
BeautifulSoup(result, "html.parser")
|
||||
|
||||
def get_ppn(self, searchterm: str) -> str | None:
|
||||
links = self.get_book_links(searchterm)
|
||||
ppn = None
|
||||
for link in links:
|
||||
result = self.search(link)
|
||||
soup = BeautifulSoup(result, "html.parser")
|
||||
# debug: link
|
||||
# print(link)
|
||||
BeautifulSoup(result, "html.parser")
|
||||
# debug: link
|
||||
# print(link)
|
||||
ppn = link.split("/")[-1]
|
||||
if ppn and regex.match(r"^\d{8,10}[X\d]?$", ppn):
|
||||
return ppn
|
||||
@@ -268,8 +268,8 @@ class Catalogue:
|
||||
|
||||
# Find the signature for the entry whose location mentions "Semesterapparat"
|
||||
for g in groups:
|
||||
# debug: group contents
|
||||
# print(g)
|
||||
# debug: group contents
|
||||
# print(g)
|
||||
loc = g.get("location", "").lower()
|
||||
if "semesterapparat" in loc:
|
||||
signature = g.get("signature")
|
||||
|
||||
@@ -5,7 +5,7 @@ from pyzotero import zotero
|
||||
|
||||
from src import settings
|
||||
from src.services.webrequest import BibTextTransformer, WebRequest
|
||||
from src.shared.logging import log, get_bloat_logger, preview
|
||||
from src.shared.logging import get_bloat_logger, preview
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -216,7 +216,9 @@ class ZoteroController:
|
||||
resp = self.zot.create_items([item]) # type: ignore
|
||||
if "successful" in resp.keys():
|
||||
bloat = get_bloat_logger()
|
||||
bloat.debug("Zotero create_items response (preview): {}", preview(resp, 1000))
|
||||
bloat.debug(
|
||||
"Zotero create_items response (preview): {}", preview(resp, 1000)
|
||||
)
|
||||
return resp["successful"]["0"]["key"]
|
||||
else:
|
||||
return None
|
||||
@@ -249,7 +251,9 @@ class ZoteroController:
|
||||
]
|
||||
chapter.creators += authors
|
||||
|
||||
bloat.debug("Zotero Chapter payload (preview): {}", preview(chapter.to_dict(), 1000))
|
||||
bloat.debug(
|
||||
"Zotero Chapter payload (preview): {}", preview(chapter.to_dict(), 1000)
|
||||
)
|
||||
return self.createItem(chapter.to_dict())
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user