def mock_getAlgorithm(name): """ Modified version of the original getAlgorithm function. :param name: Name of the algorithm to load. :type name: str :return: An algorithm concrete class. :rtype: QgsAlgorithm ? """ Processing.initialize() algorithms = list() try: algorithms = Processing.algs.values() except AttributeError: algorithms = Processing.algs().values() for provider in algorithms: if name in provider: return provider[name] return None
def mock_getAlgorithm(name): """ Modified version of the original getAlgorithm function. :param name: Name of the algorithm to load. :type name: str :return: An algorithm concrete class. :rtype: QgsAlgorithm ? """ Processing.initialize() # FIXME: Had some weird bug in QGIS 2.18 MacOSX (KyngChaos) try: providers = Processing.algs.values() except: providers = Processing.algs().values() for provider in providers: if name in provider: return provider[name] return None