From f8a2ae866bc2115e1c0589f1a97902447260e7fd Mon Sep 17 00:00:00 2001 From: Archit Agrawal <archit18221@iiit.ac.in> Date: Sat, 8 Jun 2019 16:51:57 +0530 Subject: [PATCH] swh.lister.core: Remove abstractmethod Some of the new listers like GNU and CRAN do not follow the conventional way of making an HTTP request, hence they do not need some of the methods which are usually needed by in conventional HTTP request. But those method are marked abstractmethod in the core making them necessary to be present. So it is in best to remove abstractmethod to increase the readability of those listers. --- swh/lister/core/lister_base.py | 4 ---- swh/lister/core/simple_lister.py | 2 -- 2 files changed, 6 deletions(-) diff --git a/swh/lister/core/lister_base.py b/swh/lister/core/lister_base.py index a742453e..22a35f89 100644 --- a/swh/lister/core/lister_base.py +++ b/swh/lister/core/lister_base.py @@ -70,7 +70,6 @@ class SWHListerBase(abc.ABC, config.SWHConfig): ' customized for a specific service.') LISTER_NAME = AbstractAttribute("Lister's name") - @abc.abstractmethod def transport_request(self, identifier): """Given a target endpoint identifier to query, try once to request it. @@ -91,7 +90,6 @@ class SWHListerBase(abc.ABC, config.SWHConfig): """ pass - @abc.abstractmethod def transport_response_to_string(self, response): """Convert the server response into a formatted string for logging. @@ -105,7 +103,6 @@ class SWHListerBase(abc.ABC, config.SWHConfig): """ pass - @abc.abstractmethod def transport_response_simplified(self, response): """Convert the server response into list of a dict for each repo in the response, mapping columns in the lister's MODEL class to repo data. @@ -122,7 +119,6 @@ class SWHListerBase(abc.ABC, config.SWHConfig): """ pass - @abc.abstractmethod def transport_quota_check(self, response): """Check server response to see if we're hitting request rate limits. diff --git a/swh/lister/core/simple_lister.py b/swh/lister/core/simple_lister.py index 8455a795..11060eb5 100644 --- a/swh/lister/core/simple_lister.py +++ b/swh/lister/core/simple_lister.py @@ -2,7 +2,6 @@ # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information -import abc import logging from swh.core import utils @@ -20,7 +19,6 @@ class SimpleLister(SWHListerBase): information and stores those in db """ - @abc.abstractmethod def list_packages(self, *args): """Listing packages method. -- GitLab