This repository has been archived on 2024-12-18. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-18/src/plugins/plugin.py

15 lines
450 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
import pkg_resources
def get_plugins(group, point='', name=None):
for plugin in pkg_resources.iter_entry_points(group):
if plugin.name == name or plugin.name.startswith(point):
try:
yield plugin.load().connect_plugin
except (AttributeError,
pkg_resources.DistributionNotFound,
pkg_resources.UnknownExtra):
continue