Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/gnu/lister.py
Show All 27 Lines | def task_dict(self, origin_type, origin_url, **kwargs): | ||||
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. | ||||
This creates tasks with args and kwargs set, for example: | This creates tasks with args and kwargs set, for example: | ||||
.. code-block:: python | .. code-block:: python | ||||
args: ['https://ftp.gnu.org/gnu/3dldf/'] | args: | ||||
kwargs: { | kwargs: { | ||||
'tarballs': [{ | 'url': 'https://ftp.gnu.org/gnu/3dldf/', | ||||
'archive': 'https://...', | 'artifacts': [{ | ||||
'url': 'https://...', | |||||
'time': 1071002600, | 'time': 1071002600, | ||||
'length': 128}, | 'length': 128}, | ||||
... | ... | ||||
]} | ]} | ||||
""" | """ | ||||
tarballs = self.gnu_tree.artifacts[origin_url] | artifacts = self.gnu_tree.artifacts[origin_url] | ||||
return utils.create_task_dict( | return utils.create_task_dict( | ||||
'load-%s' % origin_type, | 'load-%s' % origin_type, | ||||
kwargs.get('policy', 'oneshot'), | kwargs.get('policy', 'oneshot'), | ||||
origin_url, | url=origin_url, | ||||
tarballs=tarballs) | artifacts=artifacts) | ||||
def safely_issue_request(self, identifier): | def safely_issue_request(self, identifier): | ||||
"""Bypass the implementation. It's now the GNUTree which deals with | """Bypass the implementation. It's now the GNUTree which deals with | ||||
querying the gnu mirror. | querying the gnu mirror. | ||||
As an implementation detail, we cannot change simply the base | As an implementation detail, we cannot change simply the base | ||||
SimpleLister as other implementation still uses it. This shall be part | SimpleLister as other implementation still uses it. This shall be part | ||||
of another refactoring pass. | of another refactoring pass. | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |