2017-03-01 15:46:13 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import pkg_resources
|
|
|
|
|
|
|
|
|
2017-03-10 00:00:54 +01:00
|
|
|
def get_plugins(group, point='', name=None):
|
2017-03-01 15:46:13 +01:00
|
|
|
for plugin in pkg_resources.iter_entry_points(group):
|
2017-03-10 00:00:54 +01:00
|
|
|
if plugin.name == name or plugin.name.startswith(point):
|
2017-03-01 15:46:13 +01:00
|
|
|
try:
|
|
|
|
yield plugin.load().connect_plugin
|
2017-03-10 00:00:54 +01:00
|
|
|
except (AttributeError,
|
|
|
|
pkg_resources.DistributionNotFound,
|
|
|
|
pkg_resources.UnknownExtra):
|
2017-03-01 15:46:13 +01:00
|
|
|
continue
|