various updates and changes, move admin widgets into different seperate dialogs
This commit is contained in:
@@ -133,10 +133,8 @@ class ARRAYData:
|
||||
return data
|
||||
|
||||
except Exception:
|
||||
# print(f"ARRAYData.transform failed, {source}, {search}")
|
||||
logger.log_exception(
|
||||
f"ARRAYData.transform failed, no string {search}, {source}, {search}"
|
||||
)
|
||||
# # print(f"ARRAYData.transform failed, {source}, {search}")
|
||||
logger.log_exception(f"ARRAYData.transform failed, no string {search}")
|
||||
return ""
|
||||
|
||||
def _get_list_entry(source: str, search: str, entry: str) -> str:
|
||||
@@ -218,9 +216,20 @@ class ARRAYData:
|
||||
else:
|
||||
pass
|
||||
return ";".join(authors)
|
||||
|
||||
def _get_title(data):
|
||||
titledata = None
|
||||
title = ""
|
||||
if "[ti_long]" in data:
|
||||
titledata = data.split("[ti_long]")[1].split(")\n")[0].strip()
|
||||
title = titledata.split("=>")[1].strip().split("/")[0].strip()
|
||||
if "[ti_long_f]" in data:
|
||||
titledata = data.split("[ti_long_f]")[1].split(")\n")[0].strip()
|
||||
title = titledata.split("=>")[1].strip().split("/")[0].strip()
|
||||
return title
|
||||
return BookData(
|
||||
ppn=_get_line(data, "[kid]"),
|
||||
title=_get_line(data, "[ti_long]").split("/")[0].strip(),
|
||||
title=_get_title(data).strip(),
|
||||
author=_get_author(data),
|
||||
edition=_get_list_entry(data, "[ausgabe]", "[0]").replace(",", ""),
|
||||
link=f"https://rds.ibs-bw.de/phfreiburg/link?kid={_get_line(data,'[kid]')}",
|
||||
@@ -403,7 +412,6 @@ class DictToTable:
|
||||
setattr(self, key, None)
|
||||
|
||||
def transform(self, data: dict):
|
||||
print(data)
|
||||
mode = data["mode"]
|
||||
self.reset()
|
||||
if mode == "book":
|
||||
@@ -465,4 +473,4 @@ if __name__ == "__main__":
|
||||
|
||||
ret = RDSData().transform(data)
|
||||
data = ret.return_data("rds_availability")
|
||||
print(data)
|
||||
# print(data)
|
||||
|
||||
Reference in New Issue
Block a user