class PluginManager(): ''' Its purpose is to provide more integrated way to manage modules/ plugins. ''' def __init__(self, plugin_dir, debug=False): self.plugin_dir = plugin_dir self.spm = VersionedPluginManager() self.spm.setPluginPlaces([self.plugin_dir]) self.spm.collectPlugins() self.available_plugins = [] self.debug = debug
def _find_parsers(self): manager = VersionedPluginManager() manager.setPluginPlaces([ const.RESULTPARSERDIR, os.path.join(const.PLUGINDIR, "resultparsers") ]) manager.collectPlugins() for plugin in manager.getAllPlugins(): name = "%s - %s" % (plugin.name, plugin.version) self.widgets.parserstore.append([plugin, name]) self.widgets.parsercombo.set_active(0)