Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/bitbucket/lister.py
Show All 23 Lines | class BitBucketLister(IndexingHttpLister): | ||||
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) | ||||
if per_page != DEFAULT_BITBUCKET_PAGE: | if per_page != DEFAULT_BITBUCKET_PAGE: | ||||
self.PATH_TEMPLATE = '%s&pagelen=%s' % ( | self.PATH_TEMPLATE = '%s&pagelen=%s' % ( | ||||
self.PATH_TEMPLATE, per_page) | self.PATH_TEMPLATE, 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 get_model_from_repo(self, repo): | def get_model_from_repo(self, repo): | ||||
return { | return { | ||||
'uid': repo['uuid'], | 'uid': repo['uuid'], | ||||
'indexable': repo['created_on'], | 'indexable': repo['created_on'], | ||||
'name': repo['name'], | 'name': repo['name'], | ||||
'full_name': repo['full_name'], | 'full_name': repo['full_name'], | ||||
'html_url': repo['links']['html']['href'], | 'html_url': repo['links']['html']['href'], | ||||
▲ Show 20 Lines • Show All 55 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?