Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/bitbucket/lister.py
Show All 22 Lines | class BitBucketLister(IndexingHttpLister): | ||||
PATH_TEMPLATE = '/repositories?after=%s' | PATH_TEMPLATE = '/repositories?after=%s' | ||||
MODEL = BitBucketModel | MODEL = BitBucketModel | ||||
LISTER_NAME = 'bitbucket' | LISTER_NAME = 'bitbucket' | ||||
instance = 'bitbucket' | instance = 'bitbucket' | ||||
def __init__(self, api_baseurl, override_config=None, per_page=100): | def __init__(self, api_baseurl, override_config=None, per_page=100): | ||||
super().__init__( | super().__init__( | ||||
api_baseurl=api_baseurl, override_config=override_config) | api_baseurl=api_baseurl, override_config=override_config) | ||||
self.per_page = per_page | self.per_page = per_page | ||||
vlorentz: I'm confused by this comment. Prior behavior of what? (I can deduce IndexingLister because it's… | |||||
Done Inline ActionsBecause i changed the packet size returned by the api from 10 repositories (too small) to 100 repositories (a tad better) for the bitbucket listing. so 2 iterations of 100 repositories, i already have the 200 repositories to flush in db. ardumont: Because i changed the packet size returned by the api from 10 repositories (too small) to 100… | |||||
# to stay consistent with prior behavior (20 * 10 repositories then) | |||||
self.flush_packet_db = int( | |||||
(self.flush_packet_db * DEFAULT_BITBUCKET_PAGE) / per_page) | |||||
def request_params(self, identifier): | def request_params(self, identifier): | ||||
"""Deal properly with extra api call query parameters. | """Deal properly with extra api call query parameters. | ||||
This installs the `pagelen` query parameter in charge of quantity of | This installs the `pagelen` query parameter in charge of quantity of | ||||
repositories to return per api call. | repositories to return per api call. | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |
I'm confused by this comment. Prior behavior of what? (I can deduce IndexingLister because it's in the same diff, but it won't make sense afterward.) And why does the Bitbucket lister need to override this behavior?