swh.lister.cran.lister module¶
-
class
swh.lister.cran.lister.
CRANLister
(override_config=None)[source]¶ Bases:
swh.lister.core.simple_lister.SimpleLister
-
MODEL
¶ alias of
swh.lister.cran.models.CRANModel
-
LISTER_NAME
= 'cran'¶
-
instance
= 'cran'¶
-
task_dict
(origin_type, origin_url, version=None, html_url=None, policy=None, **kwargs)[source]¶ Return task format dict. This creates tasks with args and kwargs set, for example:
args: [] kwargs: { 'url': 'https://cran.r-project.org/Packages/<package>...', 'artifacts': [{ 'url': 'https://cran.r-project.org/...', 'version': '0.0.1', }] }
-
safely_issue_request
(identifier)[source]¶ Bypass the implementation. It’s now the list_packages which returns data.
As an implementation detail, we cannot change simply the base SimpleLister yet as other implementation still uses it. This shall be part of another refactoring pass.
-
list_packages
(response) → List[Mapping[str, str]][source]¶ - Runs R script which uses inbuilt API to return a json response
containing data about the R packages.
- Returns
List of Dict about R packages. For example:
[ { 'Package': 'A3', 'Version': '1.0.0', 'Title': 'A3 package', 'Description': ... }, { 'Package': 'abbyyR', 'Version': '0.5.4', 'Title': 'Access to Abbyy OCR (OCR) API', 'Description': ...' }, ... ]
-