Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/packagist/lister.py
# Copyright (C) 2019 the Software Heritage developers | # Copyright (C) 2019 the Software Heritage developers | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import random | import random | ||||
import json | import json | ||||
from .models import PackagistModel | from .models import PackagistModel | ||||
from swh.scheduler import utils | from swh.scheduler import utils | ||||
from swh.lister.core.simple_lister import SimpleLister | from swh.lister.core.simple_lister import SimpleLister | ||||
from swh.lister.core.lister_transports import ListerOnePageApiTransport | from swh.lister.core.lister_transports import ListerOnePageApiTransport | ||||
class PackagistLister(ListerOnePageApiTransport, SimpleLister): | class PackagistLister(ListerOnePageApiTransport, SimpleLister): | ||||
"""List packages available in the Packagist package manger. | """List packages available in the Packagist package manager. | ||||
The lister sends the request to the url present in the class | The lister sends the request to the url present in the class | ||||
variable `PAGE`, to receive a list of all the package names | variable `PAGE`, to receive a list of all the package names | ||||
present in the Packagist package manger. Iterates over all the | present in the Packagist package manager. Iterates over all the | ||||
packages and constructs the metadata url of the package from | packages and constructs the metadata url of the package from | ||||
the name of the package and creates a loading task. | the name of the package and creates a loading task. | ||||
Task: | Task: | ||||
Type: load-packagist | Type: load-packagist | ||||
Policy: recurring | Policy: recurring | ||||
Args: | Args: | ||||
<package_name> | <package_name> | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |