aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-06-23 20:10:03 -0700
committerBryan Newbold <bnewbold@archive.org>2020-06-23 20:10:03 -0700
commit60c02cda282bce6863d3a9ec1938729c899dc61a (patch)
treeb31bf3820915af6b26a9db5518d11c0e6e632e90
parent3d73e4e52f1522a0c097b5f96576c15736e08284 (diff)
downloadchocula-60c02cda282bce6863d3a9ec1938729c899dc61a.tar.gz
chocula-60c02cda282bce6863d3a9ec1938729c899dc61a.zip
ensure lang is len()==2; prep for original_name column
-rw-r--r--chocula/database.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/chocula/database.py b/chocula/database.py
index b800f65..fc79153 100644
--- a/chocula/database.py
+++ b/chocula/database.py
@@ -503,6 +503,7 @@ class ChoculaDatabase:
"issnp",
"publisher",
"platform",
+ "original_name",
):
if not out.get(k) and extra.get(k):
out[k] = extra[k]
@@ -589,6 +590,9 @@ class ChoculaDatabase:
out["publisher_type"] = "longtail"
out["is_longtail"] = True
+ if out.get("lang"):
+ assert len(out["lang"]) == 2
+
cur.execute(
"INSERT OR REPLACE INTO journal (issnl, issne, issnp, wikidata_qid, fatcat_ident, name, publisher, country, lang, is_oa, sherpa_color, is_longtail, is_active, publisher_type, has_dois, any_homepage, any_live_homepage, any_gwb_homepage, known_issnl, valid_issnl, release_count, ia_count, ia_frac, kbart_count, kbart_frac, preserved_count, preserved_frac) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
(
@@ -598,6 +602,7 @@ class ChoculaDatabase:
out.get("wikidata_qid"),
out.get("fatcat_ident"),
out.get("name"),
+ # out.get("original_name"),
out.get("publisher"),
out.get("country"),
out.get("lang"),