Skip to content

Commit

Permalink
Refactored exceptions.py module from input package to entities pacakge
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Collins committed Oct 19, 2021
1 parent a52d0bc commit c17792e
Show file tree
Hide file tree
Showing 24 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/pds_doi_service/api/controllers/dois_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions src/pds_doi_service/core/actions/draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pds_doi_service/core/actions/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 9 additions & 9 deletions src/pds_doi_service/core/actions/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions src/pds_doi_service/core/actions/reserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/pds_doi_service/core/actions/test/draft_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/pds_doi_service/core/input/input_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pds_doi_service/core/input/node_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/pds_doi_service/core/input/pds4_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pds_doi_service/core/input/test/input_util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions src/pds_doi_service/core/outputs/doi_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/pds_doi_service/core/outputs/osti/osti_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pds_doi_service/core/outputs/osti/osti_web_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/pds_doi_service/core/outputs/osti/osti_web_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pds_doi_service/core/outputs/test/datacite_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/pds_doi_service/core/outputs/test/doi_validator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion src/pds_doi_service/core/outputs/web_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pds_doi_service/core/util/doi_xml_differ.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c17792e

Please sign in to comment.