diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-07-31 15:22:00 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-08-03 10:50:14 -0700 |
commit | c0e77976987199e1f77e9b7d0b188656d1f5456e (patch) | |
tree | 53bd9760212f9f69180bb86b0e27b76127b365f7 | |
parent | f96ef1d9815155ce4bd0f3746fe9350e05d7eab6 (diff) | |
download | chocula-c0e77976987199e1f77e9b7d0b188656d1f5456e.tar.gz chocula-c0e77976987199e1f77e9b7d0b188656d1f5456e.zip |
doaj bug: wasn't setting extra directory metadata
-rw-r--r-- | chocula/directories/doaj.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/chocula/directories/doaj.py b/chocula/directories/doaj.py index 795ce68..a62a974 100644 --- a/chocula/directories/doaj.py +++ b/chocula/directories/doaj.py @@ -1,4 +1,4 @@ -from typing import Iterable, Optional, Dict, Any +from typing import Iterable, Optional import csv from chocula.util import ( @@ -98,27 +98,26 @@ class DoajLoader(DirectoryLoader): if lang: info.langs.append(lang) - extra: Dict[str, Any] = dict(doaj=dict()) - extra["mimetypes"] = parse_mimetypes(row["Full text formats"]) - extra["doaj"]["as_of"] = self.config.snapshot.date + info.extra["mimetypes"] = parse_mimetypes(row["Full text formats"]) + info.extra["as_of"] = self.config.snapshot.date if row["DOAJ Seal"]: - extra["doaj"]["seal"] = {"no": False, "yes": True}[row["DOAJ Seal"].lower()] + info.extra["seal"] = {"no": False, "yes": True}[row["DOAJ Seal"].lower()] if row["Digital archiving policy or program(s)"]: - extra["archive"] = [ + info.extra["archive"] = [ a.strip() for a in row["Digital archiving policy or program(s)"].split(",") if a.strip() ] elif row["Archiving: national library"]: - extra["archive"] = ["national-library"] + info.extra["archive"] = ["national-library"] crawl_permission = row["Journal full-text crawl permission"] if crawl_permission: - extra["crawl-permission"] = dict(Yes=True, No=False)[crawl_permission] + info.extra["crawl_permission"] = dict(Yes=True, No=False)[crawl_permission] default_license = row["Journal license"] if default_license and default_license.startswith("CC"): - extra["default_license"] = default_license.replace("CC ", "CC-").strip() + info.extra["default_license"] = default_license.replace("CC ", "CC-").strip() url = row["Journal URL"] if url: |