def test_updatePluginPlaces(self): class SpecificLocator(IPluginLocator): pass pm = PluginManager() pm.setPluginPlaces(["bla/bli"]) pm.updatePluginPlaces(["mif/maf"]) self.assertEqual(set(["bla/bli","mif/maf"]),set(pm.getPluginLocator().plugins_places))
def loadTechniques(self, techniquesPath, controls=None): # Build the manager, set load location, and then collect them pm = PluginManager() pm.updatePluginPlaces([techniquesPath]) pm.collectPlugins() self.techniques = dict() for pluginInfo in pm.getAllPlugins(): print('loading ' + pluginInfo.name + ' for: ' + self.name) # Get the object and store in dictionary self.techniques[pluginInfo.name] = pluginInfo.plugin_object self.techniques[pluginInfo.name].controlPlugins = controls