From 7aa19b92f0e7808a341aec8ae17485408dfae68c Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 25 May 2021 16:30:09 -0700 Subject: small python lint fixes (no behavior change) --- python/fatcat_tools/harvest/doi_registrars.py | 2 +- python/fatcat_tools/importers/common.py | 2 -- python/fatcat_tools/transforms/csl.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'python/fatcat_tools') diff --git a/python/fatcat_tools/harvest/doi_registrars.py b/python/fatcat_tools/harvest/doi_registrars.py index 03773c15..553f4e7a 100644 --- a/python/fatcat_tools/harvest/doi_registrars.py +++ b/python/fatcat_tools/harvest/doi_registrars.py @@ -143,7 +143,7 @@ class HarvestCrossrefWorker: # Datacite API returned HTTP 200, but JSON seemed unparseable. # It might be a glitch, so we retry. print("failed to decode body from {}: {}".format(http_resp.url, resp_body), file=sys.stderr) - raise + raise exc items = self.extract_items(resp) count += len(items) print("... got {} ({} of {}), HTTP fetch took {}".format(len(items), count, diff --git a/python/fatcat_tools/importers/common.py b/python/fatcat_tools/importers/common.py index fcbe9ad2..6815a155 100644 --- a/python/fatcat_tools/importers/common.py +++ b/python/fatcat_tools/importers/common.py @@ -8,9 +8,7 @@ import datetime import subprocess from collections import Counter from typing import Optional, Tuple -from confluent_kafka import Consumer, KafkaException import lxml -import xml.parsers.expat import xml.etree.ElementTree as ET import elasticsearch diff --git a/python/fatcat_tools/transforms/csl.py b/python/fatcat_tools/transforms/csl.py index 15bb369f..0556f4fe 100644 --- a/python/fatcat_tools/transforms/csl.py +++ b/python/fatcat_tools/transforms/csl.py @@ -33,7 +33,7 @@ def release_to_csl(entity): if contrib.creator: # Default to "local" (publication-specific) metadata; fall back to # creator-level - family = contrib.creator.surname or contrib.surname or (contrib.raw_name and contrib.raw_name.split()[-1]) + family = contrib.creator.surname or contrib.surname or (contrib.raw_name and contrib.raw_name.split()[-1]) if not family: # CSL requires some surname (family name) continue -- cgit v1.2.3 From db8798699bc6d06dbcab59c4617e0c5d4f94a724 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 25 May 2021 16:30:38 -0700 Subject: changelog worker: fix file/fileset typo, caught by lint This would have been resulting in some releases not getting re-indexed into search. --- python/fatcat_tools/workers/changelog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/fatcat_tools') diff --git a/python/fatcat_tools/workers/changelog.py b/python/fatcat_tools/workers/changelog.py index 94791770..982ee3ea 100644 --- a/python/fatcat_tools/workers/changelog.py +++ b/python/fatcat_tools/workers/changelog.py @@ -371,7 +371,7 @@ class EntityUpdatesWorker(FatcatWorker): for ident in set(fileset_ids): fileset_entity = self.api.get_fileset(ident, expand=None) # update release when a fileset changes - release_ids.extend(file_entity.release_ids or []) + release_ids.extend(fileset_entity.release_ids or []) # TODO: topic for webcapture updates for ident in set(webcapture_ids): -- cgit v1.2.3