Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/core/simple_lister.py
# Copyright (C) 2018 the Software Heritage developers | # Copyright (C) 2018 the Software Heritage developers | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import abc | |||||
import logging | import logging | ||||
from swh.core import utils | from swh.core import utils | ||||
from .lister_base import SWHListerBase | from .lister_base import SWHListerBase | ||||
class SimpleLister(SWHListerBase): | class SimpleLister(SWHListerBase): | ||||
"""Lister* intermediate class for any service that follows the simple, | """Lister* intermediate class for any service that follows the simple, | ||||
'list in oneshot information' pattern. | 'list in oneshot information' pattern. | ||||
- Client sends a request to list repositories in oneshot | - Client sends a request to list repositories in oneshot | ||||
- Client receives structured (json/xml/etc) response with | - Client receives structured (json/xml/etc) response with | ||||
information and stores those in db | information and stores those in db | ||||
""" | """ | ||||
@abc.abstractmethod | |||||
def list_packages(self, *args): | def list_packages(self, *args): | ||||
"""Listing packages method. | """Listing packages method. | ||||
""" | """ | ||||
pass | pass | ||||
def ingest_data(self, identifier, checks=False): | def ingest_data(self, identifier, checks=False): | ||||
"""Rework the base ingest_data. | """Rework the base ingest_data. | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |