Skip to content

Commit

Permalink
global: rename components
Browse files Browse the repository at this point in the history
* change init_config to staticmethod. self was not used

* rename components because the convert to global search and not more
  dublin core

* remove LOMMetadata, the original from lom is enough and was changed to
  have the same api as Marc21Metadata
  • Loading branch information
utnapischtim committed Nov 22, 2023
1 parent d705578 commit 276ea4e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
13 changes: 12 additions & 1 deletion invenio_global_search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@

"""Global Search for InvenioRDM."""

from .components import (
LOMToGlobalSearchComponent,
Marc21ToGlobalSearchComponent,
RDMToGlobalSearchComponent,
)
from .ext import InvenioGlobalSearch

__version__ = "0.1.0"

__all__ = ("__version__", "InvenioGlobalSearch")
__all__ = (
"__version__",
"InvenioGlobalSearch",
"LOMToGlobalSearchComponent",
"Marc21ToGlobalSearchComponent",
"RDMToGlobalSearchComponent",
)
2 changes: 1 addition & 1 deletion invenio_global_search/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
DublinCoreJSONSerializer,
)
from invenio_records_lom.records.api import LOMRecord
from invenio_records_lom.utils import LOMMetadata
from invenio_records_marc21.records.api import Marc21Record
from invenio_records_marc21.services.record import Marc21Metadata

from .components import map_metadata_from_a_to_b
from .serializers import LOMRecordJSONSerializer, Marc21RecordJSONSerializer
from .utils import LOMMetadata


def rebuild_database_rdm() -> None:
Expand Down
12 changes: 6 additions & 6 deletions invenio_global_search/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def on_post_commit(self, uow) -> None: # noqa: ARG002
)


class Marc21ToDublinCoreComponent(ServiceComponent):
"""Marc21ToDublinCoreComponent."""
class Marc21ToGlobalSearchComponent(ServiceComponent):
"""Marc21ToGlobalSearchComponent."""

def publish(
self,
Expand All @@ -115,8 +115,8 @@ def publish(
self.uow.register(cmp_op)


class LOMToDublinCoreComponent(ServiceComponent):
"""LOMToDublinCoreComponent."""
class LOMToGlobalSearchComponent(ServiceComponent):
"""LOMToGlobalSearchComponent."""

def publish(
self,
Expand All @@ -136,8 +136,8 @@ def publish(
self.uow.register(cmp_op)


class RDMToDublinCoreComponent(ServiceComponent):
"""RDMToDublinCoreComponent."""
class RDMToGlobalSearchComponent(ServiceComponent):
"""RDMToGlobalSearchComponent."""

def publish(
self,
Expand Down
3 changes: 2 additions & 1 deletion invenio_global_search/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def init_app(self, app):
self.init_config(app)
app.extensions["invenio-global-search"] = self

def init_config(self, app):
@staticmethod
def init_config(app):
"""Initialize configuration."""
for k in dir(config):
if k.startswith("GLOBAL_SEARCH_"):
Expand Down
18 changes: 0 additions & 18 deletions invenio_global_search/utils.py

This file was deleted.

0 comments on commit 276ea4e

Please sign in to comment.