Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/opam/tasks.py
- This file was added.
# Copyright (C) 2021 the Software Heritage developers | |||||
ardumont: 2021 | |||||
# License: GNU General Public License version 3, or any later version | |||||
# See top-level LICENSE file for more information | |||||
from celery import shared_task | |||||
from swh.lister.opam.lister import OpamLister | |||||
@shared_task(name=__name__ + ".OpamListerTask") | |||||
def list_opam(**lister_args): | |||||
"""Lister task for the Opam registry""" | |||||
return OpamLister.from_configfile(**lister_args).run().dict() | |||||
Done Inline ActionsTo test this part, you can look to other listers in their ...tests/<lister-name>/tests/test_tasks.py module and do something similar. ardumont: To test this part, you can look to other listers in their `...tests/<lister… | |||||
Done Inline ActionsAn example of what i was describing yesterday btw [1] ardumont: An example of what i was describing yesterday btw [1]
[1] https://forge.softwareheritage. | |||||
@shared_task(name=__name__ + ".ping") | |||||
def _ping(): | |||||
return "OK" |
2021