From 78eb2cc0f3f81c35474eb68231fe5f60d47bbcde Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 9 Nov 2021 16:04:31 -0800 Subject: lowercase DOI lint and check entity status --- python/fatcat_tools/cleanups/release_lowercase_doi.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'python/fatcat_tools') diff --git a/python/fatcat_tools/cleanups/release_lowercase_doi.py b/python/fatcat_tools/cleanups/release_lowercase_doi.py index 812262d4..4e5a6f43 100644 --- a/python/fatcat_tools/cleanups/release_lowercase_doi.py +++ b/python/fatcat_tools/cleanups/release_lowercase_doi.py @@ -1,13 +1,10 @@ import argparse -import copy import os import sys -from typing import Any, Dict -import fatcat_openapi_client from fatcat_openapi_client import ApiClient, ReleaseEntity, ReleaseExtIds -from fatcat_tools import authenticated_api, entity_from_dict, public_api +from fatcat_tools import authenticated_api, public_api from fatcat_tools.importers.common import EntityImporter, LinePusher @@ -76,6 +73,10 @@ class ReleaseLowercaseDoiCleanup(EntityImporter): self.counts["skip-existing-not-found"] += 1 return False + if existing.status != "active": + self.counts["skip-existing-entity-status"] += 1 + return False + if not existing.ext_ids.doi: self.counts["skip-existing-no-doi"] += 1 return False -- cgit v1.2.3