Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/packagist/lister.py
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | class PackagistLister(ListerOnePageApiTransport, SimpleLister): | ||||
def task_dict(self, origin_type, origin_url, **kwargs): | def task_dict(self, origin_type, origin_url, **kwargs): | ||||
"""Return task format dict | """Return task format dict | ||||
This is overridden from the lister_base as more information is | This is overridden from the lister_base as more information is | ||||
needed for the ingestion task creation. | needed for the ingestion task creation. | ||||
""" | """ | ||||
return utils.create_task_dict('load-%s' % origin_type, 'recurring', | return utils.create_task_dict('load-%s' % origin_type, | ||||
kwargs.get('policy', 'recurring'), | |||||
kwargs.get('name'), origin_url) | kwargs.get('name'), origin_url) | ||||
def list_packages(self, response): | def list_packages(self, response): | ||||
"""List the actual packagist origins from the response. | """List the actual packagist origins from the response. | ||||
""" | """ | ||||
response = json.loads(response.text) | response = json.loads(response.text) | ||||
packages = [name for name in response['packageNames']] | packages = [name for name in response['packageNames']] | ||||
Show All 22 Lines |