summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/importers
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-21 11:48:28 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-21 11:48:28 -0700
commit0988ac6fed7f1d1ba41233bde56b455ba6cba204 (patch)
tree9354db4d9000d610e9c823d77b6a174fcadf3237 /python/fatcat_tools/importers
parent192b44ed9e3b1c388c11cf0467a749470dfe1300 (diff)
downloadfatcat-0988ac6fed7f1d1ba41233bde56b455ba6cba204.tar.gz
fatcat-0988ac6fed7f1d1ba41233bde56b455ba6cba204.zip
fix lint errors in JSTOR importer
Diffstat (limited to 'python/fatcat_tools/importers')
-rw-r--r--python/fatcat_tools/importers/jstor.py33
1 files changed, 16 insertions, 17 deletions
diff --git a/python/fatcat_tools/importers/jstor.py b/python/fatcat_tools/importers/jstor.py
index 4531d926..7d630b6b 100644
--- a/python/fatcat_tools/importers/jstor.py
+++ b/python/fatcat_tools/importers/jstor.py
@@ -49,6 +49,21 @@ class JstorImporter(EntityImporter):
extra = dict()
extra_jstor = dict()
+ release_type = "article-journal"
+ if "[Abstract]" in title:
+ # TODO: strip the "[Abstract]" bit?
+ release_type = "abstract"
+ elif "[Editorial" in title:
+ release_type = "editorial"
+ elif "[Letter" in title:
+ release_type = "letter"
+ elif "[Poem" in title or "[Photograph" in title:
+ release_type = None
+
+ if title.startswith("[") and title.endswith("]"):
+ # strip brackets if that is all that is there (eg, translation or non-english)
+ title = title[1:-1]
+
# JSTOR journal-id
journal_ids = [j.string for j in journal_meta.find_all('journal-id')]
if journal_ids:
@@ -76,8 +91,7 @@ class JstorImporter(EntityImporter):
issnl=issnl,
publisher=publisher,
container_type=self.map_container_type(release_type),
- name=clean(journal_title, force_xml=True),
- extra=journal_extra)
+ name=clean(journal_title, force_xml=True))
ce_edit = self.create_container(ce)
container_id = ce_edit.ident
self._issnl_id_map[issnl] = container_id
@@ -155,21 +169,6 @@ class JstorImporter(EntityImporter):
if not language:
warnings.warn("MISSING MARC LANG: {}".format(cm.find("meta-value").string))
- release_type = "article-journal"
- if "[Abstract]" in title:
- # TODO: strip the "[Abstract]" bit?
- release_type = "abstract"
- elif "[Editorial" in title:
- release_type = "editorial"
- elif "[Letter" in title:
- release_type = "letter"
- elif "[Poem" in title or "[Photograph" in title:
- release_type = None
-
- if title.startswith("[") and title.endswith("]"):
- # strip brackets if that is all that is there (eg, translation or non-english)
- title = title[1:-1]
-
# JSTOR issue-id
if article_meta.find('issue-id'):
issue_id = clean(article_meta.find('issue-id').string)