Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/cran/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 json | import json | ||||
import logging | import logging | ||||
import pkg_resources | import pkg_resources | ||||
import subprocess | import subprocess | ||||
from collections import defaultdict | from collections import defaultdict | ||||
from typing import List, Dict | from typing import Any, Dict, List, Mapping | ||||
from swh.lister.cran.models import CRANModel | from swh.lister.cran.models import CRANModel | ||||
from swh.lister.core.simple_lister import SimpleLister | from swh.lister.core.simple_lister import SimpleLister | ||||
from swh.scheduler.utils import create_task_dict | from swh.scheduler.utils import create_task_dict | ||||
logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||
class CRANLister(SimpleLister): | class CRANLister(SimpleLister): | ||||
MODEL = CRANModel | MODEL = CRANModel | ||||
LISTER_NAME = 'cran' | LISTER_NAME = 'cran' | ||||
instance = 'cran' | instance = 'cran' | ||||
descriptions = defaultdict(dict) | descriptions = defaultdict(dict) # type: Mapping[str, Mapping[Any, Any]] | ||||
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 create_task_dict( | return create_task_dict( | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |