diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-08-31 20:04:34 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-08-31 20:04:34 -0700 |
commit | 9c139e6a824acab913e9809f21fbde48fe43ab72 (patch) | |
tree | 1cdf33f9d309c2a47190b52d9158342ee4bc68cb | |
parent | af4cb3c9d38d543e6070c622498db3a3ec9c4734 (diff) | |
download | chocula-9c139e6a824acab913e9809f21fbde48fe43ab72.tar.gz chocula-9c139e6a824acab913e9809f21fbde48fe43ab72.zip |
fmt
-rw-r--r-- | chocula/database.py | 29 | ||||
-rw-r--r-- | chocula/directories/doaj.py | 4 | ||||
-rw-r--r-- | chocula/directories/sim.py | 8 |
3 files changed, 29 insertions, 12 deletions
diff --git a/chocula/database.py b/chocula/database.py index e266b1c..8997e7e 100644 --- a/chocula/database.py +++ b/chocula/database.py @@ -799,10 +799,18 @@ class ChoculaDatabase: elif drow["slug"] == "szczepanski": extra["szczepanski"] = dict(as_of=dextra["as_of"]) elif drow["slug"] == "norwegian": - extra["norwegian"] = dict(as_of=dextra["as_of"], level=dextra.get("level")) + extra["norwegian"] = dict( + as_of=dextra["as_of"], level=dextra.get("level") + ) elif drow["slug"] == "doaj": extra["doaj"] = dict(as_of=dextra["as_of"]) - for k in ("seal", "default_license", "crawl_permission", "archive", "mimetypes"): + for k in ( + "seal", + "default_license", + "crawl_permission", + "archive", + "mimetypes", + ): if dextra.get(k) is not None: extra["doaj"][k] = dextra[k] elif drow["slug"] == "scielo": @@ -813,16 +821,21 @@ class ChoculaDatabase: elif drow["slug"] == "sim": extra["ia"] = extra.get("ia", {}) extra["ia"]["sim"] = dict(sim_pubid=drow["identifier"]) - for k in ("year_spans", "pub_type", "peer_reviewed", "scholarly_peer_reviewed"): + for k in ( + "year_spans", + "pub_type", + "peer_reviewed", + "scholarly_peer_reviewed", + ): if dextra.get(k) is not None: extra["ia"]["sim"][k] = dextra[k] elif drow["slug"] in ("lockss", "clockss", "portico", "jstor"): extra["kbart"] = extra.get("kbart", {}) - extra["kbart"][drow["slug"]] = dict(year_spans=dextra['year_spans']) - if dextra.get('abbrev'): - extra['abbrev'] = dextra['abbrev'] - if dextra.get('platform'): - extra['platform'] = dextra['platform'] + extra["kbart"][drow["slug"]] = dict(year_spans=dextra["year_spans"]) + if dextra.get("abbrev"): + extra["abbrev"] = dextra["abbrev"] + if dextra.get("platform"): + extra["platform"] = dextra["platform"] out["extra"] = extra print(json.dumps(out)) diff --git a/chocula/directories/doaj.py b/chocula/directories/doaj.py index a62a974..e9c94c9 100644 --- a/chocula/directories/doaj.py +++ b/chocula/directories/doaj.py @@ -117,7 +117,9 @@ class DoajLoader(DirectoryLoader): info.extra["crawl_permission"] = dict(Yes=True, No=False)[crawl_permission] default_license = row["Journal license"] if default_license and default_license.startswith("CC"): - info.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: diff --git a/chocula/directories/sim.py b/chocula/directories/sim.py index 1eb29be..e51afa3 100644 --- a/chocula/directories/sim.py +++ b/chocula/directories/sim.py @@ -13,9 +13,9 @@ from chocula.database import DirectoryInfo def truthy(raw: Optional[str]) -> Optional[bool]: if not raw: return None - if raw.lower() == 'y': + if raw.lower() == "y": return True - if raw.lower() == 'n': + if raw.lower() == "n": return False return None @@ -67,7 +67,9 @@ class SimLoader(DirectoryLoader): extra["gaps"] = gaps if first_year and last_year: extra["year_spans"] = gaps_to_spans(first_year, last_year, gaps) - extra["scholarly_peer_reviewed"] = truthy(clean_str(row["Scholarly / Peer-\nReviewed"])) + extra["scholarly_peer_reviewed"] = truthy( + clean_str(row["Scholarly / Peer-\nReviewed"]) + ) extra["peer_reviewed"] = truthy(clean_str(row["Peer-\nReviewed"])) extra["pub_type"] = clean_str(row["Pub Type"]) |