def __get_plugin_manager():
""" Discovers and instantiates all plugins, returning a management object.
Returns:
yapsy.PluginManager: The plugin manager with the loaded plugins.
"""
# Build the manager
plugin_manager = PluginManager()
# the location of the plugins that ship with scriptabit
package_plugin_path = resource_filename(
Requirement.parse("scriptabit"),
os.path.join('scriptabit', 'plugins'))
# user plugin location
user_plugin_path = __init_user_plugin_directory()
# Set plugin locations
plugin_manager.setPluginPlaces([package_plugin_path, user_plugin_path])
# Load all plugins
plugin_manager.collectPlugins()
return plugin_manager
评论列表
文章目录