You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
356 B
Python
13 lines
356 B
Python
7 years ago
|
# -*- 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.startswith(point):
|
||
|
try:
|
||
|
yield plugin.load().connect_plugin
|
||
|
except (AttributeError, pkg_resources.DistributionNotFound):
|
||
|
continue
|