Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/__init__.py
Show All 9 Lines | |||||
logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||
try: | try: | ||||
__version__ = pkg_resources.get_distribution("swh.lister").version | __version__ = pkg_resources.get_distribution("swh.lister").version | ||||
except pkg_resources.DistributionNotFound: | except pkg_resources.DistributionNotFound: | ||||
__version__ = "devel" | __version__ = "devel" | ||||
USER_AGENT_TEMPLATE = "Software Heritage Lister (%s)" | USER_AGENT_TEMPLATE = ( | ||||
USER_AGENT = USER_AGENT_TEMPLATE % __version__ | f"Software Heritage %s lister v{__version__}" | ||||
" (+https://www.softwareheritage.org/contact)" | |||||
) | |||||
LISTERS = { | LISTERS = { | ||||
entry_point.name.split(".", 1)[1]: entry_point | 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" | ||||
} | } | ||||
Show All 33 Lines |