Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/__init__.py
# Copyright (C) 2018-2019 The Software Heritage developers | # Copyright (C) 2018-2019 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# 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 logging | import logging | ||||
import pkg_resources | import pkg_resources | ||||
logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||
try: | |||||
__version__ = pkg_resources.get_distribution('swh.lister').version | |||||
except pkg_resources.DistributionNotFound: | |||||
__version__ = 'devel' | |||||
LISTERS = {entry_point.name.split('.', 1)[1]: entry_point | LISTERS = {entry_point.name.split('.', 1)[1]: entry_point | ||||
for entry_point in pkg_resources.iter_entry_points('swh.workers') | for entry_point in pkg_resources.iter_entry_points('swh.workers') | ||||
if entry_point.name.split('.', 1)[0] == 'lister'} | if entry_point.name.split('.', 1)[0] == 'lister'} | ||||
SUPPORTED_LISTERS = list(LISTERS) | SUPPORTED_LISTERS = list(LISTERS) | ||||
Show All 23 Lines |