def addProvider(provider, updateList=True): """Use this method to add algorithms from external providers. """ if provider.getName() in [p.getName() for p in algList.providers]: return try: provider.initializeSettings() Processing.providers.append(provider) ProcessingConfig.readSettings() provider.loadAlgorithms() Processing.actions[provider.getName()] = provider.actions Processing.contextMenuActions.extend(provider.contextMenuActions) algList.addProvider(provider) except: ProcessingLog.addToLog( ProcessingLog.LOG_ERROR, Processing.tr("Could not load provider: %s\n%s") % (provider.getDescription(), traceback.format_exc()), ) Processing.removeProvider(provider)
def addProvider(provider, updateList=True): """Use this method to add algorithms from external providers. """ if provider.getName() in [p.getName() for p in algList.providers]: return try: provider.initializeSettings() Processing.providers.append(provider) ProcessingConfig.readSettings() provider.loadAlgorithms() Processing.actions[provider.getName()] = provider.actions Processing.contextMenuActions.extend(provider.contextMenuActions) algList.addProvider(provider) except: ProcessingLog.addToLog( ProcessingLog.LOG_ERROR, Processing.tr('Could not load provider: %s\n%s') % (provider.getDescription(), traceback.format_exc())) Processing.removeProvider(provider)
def addProvider(provider, updateList=True): """Use this method to add algorithms from external providers. """ if provider.id() in [p.id() for p in QgsApplication.processingRegistry().providers()]: return try: provider.initializeSettings() Processing.providers.append(provider) ProcessingConfig.readSettings() provider.loadAlgorithms() Processing.actions[provider.id()] = provider.actions Processing.contextMenuActions.extend(provider.contextMenuActions) algList.addProvider(provider) except: ProcessingLog.addToLog( ProcessingLog.LOG_ERROR, Processing.tr('Could not load provider: {0}\n{0}').format( provider.name(), traceback.format_exc() ) ) Processing.removeProvider(provider)