From 86ebd42b7f7e8d3be4d096443b4dc8f0c801c65e Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Wed, 22 Jul 2020 16:11:28 -0400 Subject: [PATCH] Relocate handler files in dataset search --- bento_federation_service/app.py | 4 ++-- .../search/dataset_search/handlers/__init__.py | 0 .../{search_handler.py => handlers/datasets.py} | 8 ++++---- .../private_dataset.py} | 9 +++++---- 4 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 bento_federation_service/search/dataset_search/handlers/__init__.py rename bento_federation_service/search/dataset_search/{search_handler.py => handlers/datasets.py} (96%) rename bento_federation_service/search/dataset_search/{private_search_handler.py => handlers/private_dataset.py} (94%) diff --git a/bento_federation_service/app.py b/bento_federation_service/app.py index d39d1ca..5ae47fb 100644 --- a/bento_federation_service/app.py +++ b/bento_federation_service/app.py @@ -20,8 +20,8 @@ from .db import peer_db from .peers.handlers import PeerHandler, PeerRefreshHandler from .peers.manager import PeerManager -from .search.dataset_search.private_search_handler import PrivateDatasetSearchHandler -from .search.dataset_search.search_handler import DatasetsSearchHandler +from .search.dataset_search.handlers.datasets import DatasetsSearchHandler +from .search.dataset_search.handlers.private_dataset import PrivateDatasetSearchHandler from .search.federated_dataset_search import FederatedDatasetsSearchHandler from .search.search import SearchHandler diff --git a/bento_federation_service/search/dataset_search/handlers/__init__.py b/bento_federation_service/search/dataset_search/handlers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bento_federation_service/search/dataset_search/search_handler.py b/bento_federation_service/search/dataset_search/handlers/datasets.py similarity index 96% rename from bento_federation_service/search/dataset_search/search_handler.py rename to bento_federation_service/search/dataset_search/handlers/datasets.py index 9a43e0d..c5799bb 100644 --- a/bento_federation_service/search/dataset_search/search_handler.py +++ b/bento_federation_service/search/dataset_search/handlers/datasets.py @@ -14,10 +14,10 @@ from bento_federation_service.constants import CHORD_URL, SERVICE_NAME, WORKERS from bento_federation_service.utils import peer_fetch, get_auth_header -from .constants import DATASET_SEARCH_HEADERS -from .dataset_search import run_search_on_dataset -from .process_dataset_results import process_dataset_results -from .query_utils import get_query_parts, test_queries +from ..constants import DATASET_SEARCH_HEADERS +from ..dataset_search import run_search_on_dataset +from ..process_dataset_results import process_dataset_results +from ..query_utils import get_query_parts, test_queries __all__ = [ diff --git a/bento_federation_service/search/dataset_search/private_search_handler.py b/bento_federation_service/search/dataset_search/handlers/private_dataset.py similarity index 94% rename from bento_federation_service/search/dataset_search/private_search_handler.py rename to bento_federation_service/search/dataset_search/handlers/private_dataset.py index 4eb67c7..342ed02 100644 --- a/bento_federation_service/search/dataset_search/private_search_handler.py +++ b/bento_federation_service/search/dataset_search/handlers/private_dataset.py @@ -8,10 +8,11 @@ from bento_federation_service.constants import CHORD_URL, SERVICE_NAME from bento_federation_service.utils import peer_fetch, get_auth_header -from .constants import DATASET_SEARCH_HEADERS -from .dataset_search import run_search_on_dataset -from .process_dataset_results import process_dataset_results -from .query_utils import get_query_parts, test_queries + +from ..constants import DATASET_SEARCH_HEADERS +from ..dataset_search import run_search_on_dataset +from ..process_dataset_results import process_dataset_results +from ..query_utils import get_query_parts, test_queries # noinspection PyAbstractClass