swh.lister.paging_lister: Improve lister's base class name
Also drop the SWH prefix as this is redundant.
This commit is contained in:
parent
4c4aa0ead2
commit
b6c5865ab1
3 changed files with 7 additions and 7 deletions
|
@ -9,7 +9,7 @@ from .lister_transports import SWHListerHttpTransport
|
|||
from .lister_base import SWHListerBase
|
||||
|
||||
|
||||
class SWHPagingLister(SWHListerBase):
|
||||
class PageByPageLister(SWHListerBase):
|
||||
"""Lister* intermediate class for any service that follows the simple
|
||||
pagination page pattern.
|
||||
|
||||
|
@ -126,11 +126,11 @@ class SWHPagingLister(SWHListerBase):
|
|||
self.db_session = self.mk_session()
|
||||
|
||||
|
||||
class SWHPagingHttpLister(SWHListerHttpTransport, SWHPagingLister):
|
||||
class PageByPageHttpLister(SWHListerHttpTransport, PageByPageLister):
|
||||
"""Convenience class for ensuring right lookup and init order when
|
||||
combining SWHPagingLister and SWHListerHttpTransport.
|
||||
combining PageByPageLister and SWHListerHttpTransport.
|
||||
|
||||
"""
|
||||
def __init__(self, api_baseurl=None, override_config=None):
|
||||
SWHListerHttpTransport.__init__(self, api_baseurl=api_baseurl)
|
||||
SWHPagingLister.__init__(self, override_config=override_config)
|
||||
PageByPageLister.__init__(self, override_config=override_config)
|
||||
|
|
|
@ -24,7 +24,7 @@ class HttpListerTesterBase(abc.ABC):
|
|||
"""Base testing class for subclasses of
|
||||
|
||||
swh.lister.core.indexing_lister.SWHIndexingHttpLister.
|
||||
swh.lister.core.paging_lister.SWHPagingHttpLister
|
||||
swh.lister.core.paging_lister.PageByPageHttpLister
|
||||
|
||||
See swh.lister.github.tests.test_gh_lister for an example of how
|
||||
to customize for a specific listing service.
|
||||
|
|
|
@ -6,11 +6,11 @@ import random
|
|||
import re
|
||||
import time
|
||||
|
||||
from ..core.paging_lister import SWHPagingHttpLister
|
||||
from ..core.paging_lister import PageByPageHttpLister
|
||||
from .models import GitLabModel
|
||||
|
||||
|
||||
class GitLabLister(SWHPagingHttpLister):
|
||||
class GitLabLister(PageByPageHttpLister):
|
||||
# Template path expecting an integer that represents the page id
|
||||
PATH_TEMPLATE = '/projects?page=%d&order_by=id&sort=asc&simple=true'
|
||||
API_URL_INDEX_RE = re.compile(r'^.*/projects.*page=(\d+).*')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue