diff --git a/features/steps/steps.py b/features/steps/steps.py index fb7484e2..e7ec1806 100644 --- a/features/steps/steps.py +++ b/features/steps/steps.py @@ -8,7 +8,7 @@ import logging -from pds_doi_service.core.input.exceptions import InputFormatException, CriticalDOIException +from pds_doi_service.core.entities.exceptions import InputFormatException, CriticalDOIException from pds_doi_service.core.util.doi_xml_differ import DOIDiffer from pds_doi_service.core.actions.draft import DOICoreActionDraft from pds_doi_service.core.actions.reserve import DOICoreActionReserve diff --git a/src/pds_doi_service/api/controllers/dois_controller.py b/src/pds_doi_service/api/controllers/dois_controller.py index 06edf0d9..4d905193 100644 --- a/src/pds_doi_service/api/controllers/dois_controller.py +++ b/src/pds_doi_service/api/controllers/dois_controller.py @@ -28,11 +28,11 @@ from pds_doi_service.core.actions import DOICoreActionList from pds_doi_service.core.actions import DOICoreActionRelease from pds_doi_service.core.actions import DOICoreActionReserve -from pds_doi_service.core.input.exceptions import InputFormatException -from pds_doi_service.core.input.exceptions import NoTransactionHistoryForIdentifierException -from pds_doi_service.core.input.exceptions import UnknownIdentifierException -from pds_doi_service.core.input.exceptions import WarningDOIException -from pds_doi_service.core.input.exceptions import WebRequestException +from pds_doi_service.core.entities.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import NoTransactionHistoryForIdentifierException +from pds_doi_service.core.entities.exceptions import UnknownIdentifierException +from pds_doi_service.core.entities.exceptions import WarningDOIException +from pds_doi_service.core.entities.exceptions import WebRequestException from pds_doi_service.core.input.input_util import DOIInputUtil from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_JSON from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_XML diff --git a/src/pds_doi_service/core/actions/draft.py b/src/pds_doi_service/core/actions/draft.py index 9288423a..f659f0e2 100644 --- a/src/pds_doi_service/core/actions/draft.py +++ b/src/pds_doi_service/core/actions/draft.py @@ -18,15 +18,15 @@ from pds_doi_service.core.actions import DOICoreAction from pds_doi_service.core.actions.list import DOICoreActionList from pds_doi_service.core.entities.doi import DoiStatus -from pds_doi_service.core.input.exceptions import collect_exception_classes_and_messages -from pds_doi_service.core.input.exceptions import CriticalDOIException -from pds_doi_service.core.input.exceptions import DuplicatedTitleDOIException -from pds_doi_service.core.input.exceptions import InputFormatException -from pds_doi_service.core.input.exceptions import InvalidIdentifierException -from pds_doi_service.core.input.exceptions import NoTransactionHistoryForIdentifierException -from pds_doi_service.core.input.exceptions import raise_or_warn_exceptions -from pds_doi_service.core.input.exceptions import TitleDoesNotMatchProductTypeException -from pds_doi_service.core.input.exceptions import UnexpectedDOIActionException +from pds_doi_service.core.entities.exceptions import collect_exception_classes_and_messages +from pds_doi_service.core.entities.exceptions import CriticalDOIException +from pds_doi_service.core.entities.exceptions import DuplicatedTitleDOIException +from pds_doi_service.core.entities.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import InvalidIdentifierException +from pds_doi_service.core.entities.exceptions import NoTransactionHistoryForIdentifierException +from pds_doi_service.core.entities.exceptions import raise_or_warn_exceptions +from pds_doi_service.core.entities.exceptions import TitleDoesNotMatchProductTypeException +from pds_doi_service.core.entities.exceptions import UnexpectedDOIActionException from pds_doi_service.core.input.input_util import DOIInputUtil from pds_doi_service.core.input.node_util import NodeUtil from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_JSON diff --git a/src/pds_doi_service/core/actions/list.py b/src/pds_doi_service/core/actions/list.py index 6860aa66..20f8a512 100644 --- a/src/pds_doi_service/core/actions/list.py +++ b/src/pds_doi_service/core/actions/list.py @@ -17,7 +17,7 @@ from pds_doi_service.core.actions.action import DOICoreAction from pds_doi_service.core.db.doi_database import DOIDataBase from pds_doi_service.core.entities.doi import DoiStatus -from pds_doi_service.core.input.exceptions import UnknownIdentifierException +from pds_doi_service.core.entities.exceptions import UnknownIdentifierException from pds_doi_service.core.input.node_util import NodeUtil from pds_doi_service.core.util.general_util import get_logger diff --git a/src/pds_doi_service/core/actions/release.py b/src/pds_doi_service/core/actions/release.py index 78ba6824..a8ee36b7 100644 --- a/src/pds_doi_service/core/actions/release.py +++ b/src/pds_doi_service/core/actions/release.py @@ -14,15 +14,15 @@ from pds_doi_service.core.actions.action import DOICoreAction from pds_doi_service.core.entities.doi import DoiEvent from pds_doi_service.core.entities.doi import DoiStatus -from pds_doi_service.core.input.exceptions import collect_exception_classes_and_messages -from pds_doi_service.core.input.exceptions import CriticalDOIException -from pds_doi_service.core.input.exceptions import DuplicatedTitleDOIException -from pds_doi_service.core.input.exceptions import InputFormatException -from pds_doi_service.core.input.exceptions import InvalidIdentifierException -from pds_doi_service.core.input.exceptions import raise_or_warn_exceptions -from pds_doi_service.core.input.exceptions import SiteURLNotExistException -from pds_doi_service.core.input.exceptions import TitleDoesNotMatchProductTypeException -from pds_doi_service.core.input.exceptions import UnexpectedDOIActionException +from pds_doi_service.core.entities.exceptions import collect_exception_classes_and_messages +from pds_doi_service.core.entities.exceptions import CriticalDOIException +from pds_doi_service.core.entities.exceptions import DuplicatedTitleDOIException +from pds_doi_service.core.entities.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import InvalidIdentifierException +from pds_doi_service.core.entities.exceptions import raise_or_warn_exceptions +from pds_doi_service.core.entities.exceptions import SiteURLNotExistException +from pds_doi_service.core.entities.exceptions import TitleDoesNotMatchProductTypeException +from pds_doi_service.core.entities.exceptions import UnexpectedDOIActionException from pds_doi_service.core.input.input_util import DOIInputUtil from pds_doi_service.core.input.node_util import NodeUtil from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_JSON diff --git a/src/pds_doi_service/core/actions/reserve.py b/src/pds_doi_service/core/actions/reserve.py index 94c514d9..7239e3d5 100644 --- a/src/pds_doi_service/core/actions/reserve.py +++ b/src/pds_doi_service/core/actions/reserve.py @@ -14,15 +14,15 @@ from pds_doi_service.core.actions.action import DOICoreAction from pds_doi_service.core.entities.doi import DoiEvent from pds_doi_service.core.entities.doi import DoiStatus -from pds_doi_service.core.input.exceptions import collect_exception_classes_and_messages -from pds_doi_service.core.input.exceptions import CriticalDOIException -from pds_doi_service.core.input.exceptions import DuplicatedTitleDOIException -from pds_doi_service.core.input.exceptions import InputFormatException -from pds_doi_service.core.input.exceptions import InvalidIdentifierException -from pds_doi_service.core.input.exceptions import raise_or_warn_exceptions -from pds_doi_service.core.input.exceptions import SiteURLNotExistException -from pds_doi_service.core.input.exceptions import TitleDoesNotMatchProductTypeException -from pds_doi_service.core.input.exceptions import UnexpectedDOIActionException +from pds_doi_service.core.entities.exceptions import collect_exception_classes_and_messages +from pds_doi_service.core.entities.exceptions import CriticalDOIException +from pds_doi_service.core.entities.exceptions import DuplicatedTitleDOIException +from pds_doi_service.core.entities.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import InvalidIdentifierException +from pds_doi_service.core.entities.exceptions import raise_or_warn_exceptions +from pds_doi_service.core.entities.exceptions import SiteURLNotExistException +from pds_doi_service.core.entities.exceptions import TitleDoesNotMatchProductTypeException +from pds_doi_service.core.entities.exceptions import UnexpectedDOIActionException from pds_doi_service.core.input.input_util import DOIInputUtil from pds_doi_service.core.input.node_util import NodeUtil from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_JSON diff --git a/src/pds_doi_service/core/actions/test/draft_test.py b/src/pds_doi_service/core/actions/test/draft_test.py index 265e3475..cb629eb0 100644 --- a/src/pds_doi_service/core/actions/test/draft_test.py +++ b/src/pds_doi_service/core/actions/test/draft_test.py @@ -10,8 +10,8 @@ from pds_doi_service.core.actions.release import DOICoreActionRelease from pds_doi_service.core.entities.doi import DoiStatus from pds_doi_service.core.entities.doi import ProductType -from pds_doi_service.core.input.exceptions import InputFormatException -from pds_doi_service.core.input.exceptions import WarningDOIException +from pds_doi_service.core.entities.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import WarningDOIException from pds_doi_service.core.outputs.service import DOIServiceFactory from pkg_resources import resource_filename diff --git a/src/pds_doi_service/core/input/exceptions.py b/src/pds_doi_service/core/entities/exceptions.py similarity index 98% rename from src/pds_doi_service/core/input/exceptions.py rename to src/pds_doi_service/core/entities/exceptions.py index b1185faf..ac5e1c65 100644 --- a/src/pds_doi_service/core/input/exceptions.py +++ b/src/pds_doi_service/core/entities/exceptions.py @@ -13,7 +13,7 @@ """ from pds_doi_service.core.util.general_util import get_logger -logger = get_logger("pds_doi_service.core.input.exceptions") +logger = get_logger(__name__) class InputFormatException(Exception): diff --git a/src/pds_doi_service/core/input/input_util.py b/src/pds_doi_service/core/input/input_util.py index ec0c86b2..a3be20aa 100644 --- a/src/pds_doi_service/core/input/input_util.py +++ b/src/pds_doi_service/core/input/input_util.py @@ -23,7 +23,7 @@ from pds_doi_service.core.entities.doi import Doi from pds_doi_service.core.entities.doi import DoiStatus from pds_doi_service.core.entities.doi import ProductType -from pds_doi_service.core.input.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import InputFormatException from pds_doi_service.core.input.pds4_util import DOIPDS4LabelUtil from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_JSON from pds_doi_service.core.outputs.osti.osti_validator import DOIOstiValidator diff --git a/src/pds_doi_service/core/input/node_util.py b/src/pds_doi_service/core/input/node_util.py index 3aeb647f..032dcb57 100644 --- a/src/pds_doi_service/core/input/node_util.py +++ b/src/pds_doi_service/core/input/node_util.py @@ -4,7 +4,7 @@ # use must be negotiated with the Office of Technology Transfer at the # California Institute of Technology. # -from pds_doi_service.core.input.exceptions import UnknownNodeException +from pds_doi_service.core.entities.exceptions import UnknownNodeException from pds_doi_service.core.util.general_util import get_logger # Get the common logger and set the level for this file. diff --git a/src/pds_doi_service/core/input/pds4_util.py b/src/pds_doi_service/core/input/pds4_util.py index f278be24..0c81ec7a 100644 --- a/src/pds_doi_service/core/input/pds4_util.py +++ b/src/pds_doi_service/core/input/pds4_util.py @@ -17,7 +17,7 @@ from pds_doi_service.core.entities.doi import Doi from pds_doi_service.core.entities.doi import DoiStatus from pds_doi_service.core.entities.doi import ProductType -from pds_doi_service.core.input.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import InputFormatException from pds_doi_service.core.util.general_util import create_landing_page_url from pds_doi_service.core.util.general_util import get_logger from pds_doi_service.core.util.keyword_tokenizer import KeywordTokenizer diff --git a/src/pds_doi_service/core/input/test/input_util_test.py b/src/pds_doi_service/core/input/test/input_util_test.py index 7019a2ec..e4c49d80 100644 --- a/src/pds_doi_service/core/input/test/input_util_test.py +++ b/src/pds_doi_service/core/input/test/input_util_test.py @@ -8,7 +8,7 @@ from pds_doi_service.core.entities.doi import Doi from pds_doi_service.core.entities.doi import DoiStatus from pds_doi_service.core.entities.doi import ProductType -from pds_doi_service.core.input.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import InputFormatException from pds_doi_service.core.input.input_util import DOIInputUtil from pds_doi_service.core.outputs.service import DOIServiceFactory from pds_doi_service.core.outputs.service import SERVICE_TYPE_OSTI diff --git a/src/pds_doi_service/core/outputs/datacite/datacite_validator.py b/src/pds_doi_service/core/outputs/datacite/datacite_validator.py index 7ba19d14..1367288b 100644 --- a/src/pds_doi_service/core/outputs/datacite/datacite_validator.py +++ b/src/pds_doi_service/core/outputs/datacite/datacite_validator.py @@ -16,7 +16,7 @@ from os.path import exists import jsonschema -from pds_doi_service.core.input.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import InputFormatException from pds_doi_service.core.outputs.service_validator import DOIServiceValidator from pds_doi_service.core.util.general_util import get_logger from pkg_resources import resource_filename diff --git a/src/pds_doi_service/core/outputs/datacite/datacite_web_client.py b/src/pds_doi_service/core/outputs/datacite/datacite_web_client.py index 5e6220e8..3efdc0dd 100644 --- a/src/pds_doi_service/core/outputs/datacite/datacite_web_client.py +++ b/src/pds_doi_service/core/outputs/datacite/datacite_web_client.py @@ -15,7 +15,7 @@ import pprint import requests -from pds_doi_service.core.input.exceptions import WebRequestException +from pds_doi_service.core.entities.exceptions import WebRequestException from pds_doi_service.core.outputs.datacite.datacite_web_parser import DOIDataCiteWebParser from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_JSON from pds_doi_service.core.outputs.web_client import DOIWebClient diff --git a/src/pds_doi_service/core/outputs/datacite/datacite_web_parser.py b/src/pds_doi_service/core/outputs/datacite/datacite_web_parser.py index 6bd3144d..49a58b16 100644 --- a/src/pds_doi_service/core/outputs/datacite/datacite_web_parser.py +++ b/src/pds_doi_service/core/outputs/datacite/datacite_web_parser.py @@ -19,8 +19,8 @@ from pds_doi_service.core.entities.doi import Doi from pds_doi_service.core.entities.doi import DoiStatus from pds_doi_service.core.entities.doi import ProductType -from pds_doi_service.core.input.exceptions import InputFormatException -from pds_doi_service.core.input.exceptions import UnknownIdentifierException +from pds_doi_service.core.entities.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import UnknownIdentifierException from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_JSON from pds_doi_service.core.outputs.web_parser import DOIWebParser from pds_doi_service.core.util.general_util import get_logger diff --git a/src/pds_doi_service/core/outputs/doi_validator.py b/src/pds_doi_service/core/outputs/doi_validator.py index 3549ef54..a672e793 100644 --- a/src/pds_doi_service/core/outputs/doi_validator.py +++ b/src/pds_doi_service/core/outputs/doi_validator.py @@ -19,13 +19,13 @@ from pds_doi_service.core.db.doi_database import DOIDataBase from pds_doi_service.core.entities.doi import Doi from pds_doi_service.core.entities.doi import DoiStatus -from pds_doi_service.core.input.exceptions import DuplicatedTitleDOIException -from pds_doi_service.core.input.exceptions import IllegalDOIActionException -from pds_doi_service.core.input.exceptions import InvalidIdentifierException -from pds_doi_service.core.input.exceptions import InvalidRecordException -from pds_doi_service.core.input.exceptions import SiteURLNotExistException -from pds_doi_service.core.input.exceptions import TitleDoesNotMatchProductTypeException -from pds_doi_service.core.input.exceptions import UnexpectedDOIActionException +from pds_doi_service.core.entities.exceptions import DuplicatedTitleDOIException +from pds_doi_service.core.entities.exceptions import IllegalDOIActionException +from pds_doi_service.core.entities.exceptions import InvalidIdentifierException +from pds_doi_service.core.entities.exceptions import InvalidRecordException +from pds_doi_service.core.entities.exceptions import SiteURLNotExistException +from pds_doi_service.core.entities.exceptions import TitleDoesNotMatchProductTypeException +from pds_doi_service.core.entities.exceptions import UnexpectedDOIActionException from pds_doi_service.core.util.config_parser import DOIConfigUtil from pds_doi_service.core.util.general_util import get_logger diff --git a/src/pds_doi_service/core/outputs/osti/osti_validator.py b/src/pds_doi_service/core/outputs/osti/osti_validator.py index 5f9c5790..aa2d8612 100644 --- a/src/pds_doi_service/core/outputs/osti/osti_validator.py +++ b/src/pds_doi_service/core/outputs/osti/osti_validator.py @@ -19,7 +19,7 @@ from lxml import etree from lxml import isoschematron # type: ignore from pds_doi_service.core.entities.doi import DoiStatus -from pds_doi_service.core.input.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import InputFormatException from pds_doi_service.core.outputs.service_validator import DOIServiceValidator from pds_doi_service.core.util.general_util import get_logger from pkg_resources import resource_filename diff --git a/src/pds_doi_service/core/outputs/osti/osti_web_client.py b/src/pds_doi_service/core/outputs/osti/osti_web_client.py index ba13f79f..1b0b70ea 100644 --- a/src/pds_doi_service/core/outputs/osti/osti_web_client.py +++ b/src/pds_doi_service/core/outputs/osti/osti_web_client.py @@ -15,7 +15,7 @@ import pprint import requests -from pds_doi_service.core.input.exceptions import WebRequestException +from pds_doi_service.core.entities.exceptions import WebRequestException from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_JSON from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_XML from pds_doi_service.core.outputs.osti.osti_web_parser import DOIOstiWebParser diff --git a/src/pds_doi_service/core/outputs/osti/osti_web_parser.py b/src/pds_doi_service/core/outputs/osti/osti_web_parser.py index 55b870c2..d01db090 100644 --- a/src/pds_doi_service/core/outputs/osti/osti_web_parser.py +++ b/src/pds_doi_service/core/outputs/osti/osti_web_parser.py @@ -20,8 +20,8 @@ from pds_doi_service.core.entities.doi import Doi from pds_doi_service.core.entities.doi import DoiStatus from pds_doi_service.core.entities.doi import ProductType -from pds_doi_service.core.input.exceptions import InputFormatException -from pds_doi_service.core.input.exceptions import UnknownIdentifierException +from pds_doi_service.core.entities.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import UnknownIdentifierException from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_JSON from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_XML from pds_doi_service.core.outputs.web_parser import DOIWebParser diff --git a/src/pds_doi_service/core/outputs/test/datacite_test.py b/src/pds_doi_service/core/outputs/test/datacite_test.py index aec28b95..be991556 100644 --- a/src/pds_doi_service/core/outputs/test/datacite_test.py +++ b/src/pds_doi_service/core/outputs/test/datacite_test.py @@ -11,7 +11,7 @@ from pds_doi_service.core.entities.doi import Doi from pds_doi_service.core.entities.doi import DoiStatus from pds_doi_service.core.entities.doi import ProductType -from pds_doi_service.core.input.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import InputFormatException from pds_doi_service.core.outputs.datacite import DOIDataCiteRecord from pds_doi_service.core.outputs.datacite import DOIDataCiteValidator from pds_doi_service.core.outputs.datacite import DOIDataCiteWebClient diff --git a/src/pds_doi_service/core/outputs/test/doi_validator_test.py b/src/pds_doi_service/core/outputs/test/doi_validator_test.py index fdf7e2ba..2f452201 100644 --- a/src/pds_doi_service/core/outputs/test/doi_validator_test.py +++ b/src/pds_doi_service/core/outputs/test/doi_validator_test.py @@ -13,12 +13,12 @@ from pds_doi_service.core.entities.doi import Doi from pds_doi_service.core.entities.doi import DoiStatus from pds_doi_service.core.entities.doi import ProductType -from pds_doi_service.core.input.exceptions import DuplicatedTitleDOIException -from pds_doi_service.core.input.exceptions import IllegalDOIActionException -from pds_doi_service.core.input.exceptions import InvalidIdentifierException -from pds_doi_service.core.input.exceptions import InvalidRecordException -from pds_doi_service.core.input.exceptions import TitleDoesNotMatchProductTypeException -from pds_doi_service.core.input.exceptions import UnexpectedDOIActionException +from pds_doi_service.core.entities.exceptions import DuplicatedTitleDOIException +from pds_doi_service.core.entities.exceptions import IllegalDOIActionException +from pds_doi_service.core.entities.exceptions import InvalidIdentifierException +from pds_doi_service.core.entities.exceptions import InvalidRecordException +from pds_doi_service.core.entities.exceptions import TitleDoesNotMatchProductTypeException +from pds_doi_service.core.entities.exceptions import UnexpectedDOIActionException from pds_doi_service.core.outputs.doi_validator import DOIValidator diff --git a/src/pds_doi_service/core/outputs/web_client.py b/src/pds_doi_service/core/outputs/web_client.py index 17fb5d24..1f8ffa64 100644 --- a/src/pds_doi_service/core/outputs/web_client.py +++ b/src/pds_doi_service/core/outputs/web_client.py @@ -16,7 +16,7 @@ from typing import Optional import requests -from pds_doi_service.core.input.exceptions import WebRequestException +from pds_doi_service.core.entities.exceptions import WebRequestException from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_XML from pds_doi_service.core.outputs.web_parser import DOIWebParser from pds_doi_service.core.util.config_parser import DOIConfigUtil diff --git a/src/pds_doi_service/core/util/doi_xml_differ.py b/src/pds_doi_service/core/util/doi_xml_differ.py index f5ce3300..e3163428 100644 --- a/src/pds_doi_service/core/util/doi_xml_differ.py +++ b/src/pds_doi_service/core/util/doi_xml_differ.py @@ -9,7 +9,7 @@ import datetime from lxml import etree -from pds_doi_service.core.input.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import InputFormatException from pds_doi_service.core.input.node_util import NodeUtil from pds_doi_service.core.util.general_util import get_logger diff --git a/src/pds_doi_service/core/util/initialize_production_deployment.py b/src/pds_doi_service/core/util/initialize_production_deployment.py index 04f05216..d4a82928 100644 --- a/src/pds_doi_service/core/util/initialize_production_deployment.py +++ b/src/pds_doi_service/core/util/initialize_production_deployment.py @@ -63,8 +63,8 @@ import os from datetime import datetime -from pds_doi_service.core.input.exceptions import CriticalDOIException -from pds_doi_service.core.input.exceptions import InputFormatException +from pds_doi_service.core.entities.exceptions import CriticalDOIException +from pds_doi_service.core.entities.exceptions import InputFormatException from pds_doi_service.core.outputs.doi_record import CONTENT_TYPE_JSON from pds_doi_service.core.outputs.osti.osti_web_parser import DOIOstiXmlWebParser from pds_doi_service.core.outputs.service import DOIServiceFactory