Beispiel #1
0
 def addProvider(provider, updateList = False):
     '''use this method to add algorithms from external providers'''
     '''Adding a new provider automatically initializes it, so there is no need to do it in advance'''
     #Note: this might slow down the initialization process if there are many new providers added.
     #Should think of a different solution
     provider.initializeSettings()
     Processing.providers.append(provider)
     ProcessingConfig.loadSettings()
     if updateList:
         Processing.updateAlgsList()
Beispiel #2
0
 def removeProvider(provider):
     '''Use this method to remove a provider.
     This method should be called when unloading a plugin that contributes a provider'''
     try:
         provider.unload()
         Processing.providers.remove(provider)
         ProcessingConfig.loadSettings()
         Processing.updateAlgsList()
     except:
         pass #This try catch block is here to avoid problems if the plugin with a provider is unloaded
Beispiel #3
0
 def addProvider(provider, updateList = False):
     '''use this method to add algorithms from external providers'''
     '''Adding a new provider automatically initializes it, so there is no need to do it in advance'''
     #Note: this might slow down the initialization process if there are many new providers added.
     #Should think of a different solution
     try:
         provider.initializeSettings()
         Processing.providers.append(provider)
         ProcessingConfig.loadSettings()
         if updateList:
             Processing.updateAlgsList()
     except:
         ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, "Could not load provider:" 
                                + provider.getDescription() + "\n" + unicode(sys.exc_info()[1]))
         Processing.removeProvider(provider)
Beispiel #4
0
    def removeProvider(provider):
        """Use this method to remove a provider.

        This method should be called when unloading a plugin that
        contributes a provider.
        """
        try:
            provider.unload()
            Processing.providers.remove(provider)
            ProcessingConfig.loadSettings()
            Processing.updateAlgsList()
        except:
            # This try catch block is here to avoid problems if the
            # plugin with a provider is unloaded after the Processing
            # framework itself has been unloaded. It is a quick fix
            # before I found out how to properly avoid that.
            pass
Beispiel #5
0
    def removeProvider(provider):
        """Use this method to remove a provider.

        This method should be called when unloading a plugin that
        contributes a provider.
        """
        try:
            provider.unload()
            Processing.providers.remove(provider)
            ProcessingConfig.loadSettings()
            Processing.updateAlgsList()
        except:
            # This try catch block is here to avoid problems if the
            # plugin with a provider is unloaded after the Processing
            # framework itself has been unloaded. It is a quick fix
            # before I found out how to properly avoid that.
            pass
Beispiel #6
0
    def addProvider(provider, updateList=False):
        """Use this method to add algorithms from external providers.
        """

        # Note: this might slow down the initialization process if
        # there are many new providers added. Should think of a
        # different solution
        try:
            provider.initializeSettings()
            Processing.providers.append(provider)
            ProcessingConfig.loadSettings()
            if updateList:
                Processing.updateAlgsList()
        except:
            ProcessingLog.addToLog(
                ProcessingLog.LOG_ERROR, 'Could not load provider:' +
                provider.getDescription() + '\n' + unicode(sys.exc_info()[1]))
            Processing.removeProvider(provider)
Beispiel #7
0
    def addProvider(provider, updateList=False):
        """Use this method to add algorithms from external providers.
        """

        # Note: this might slow down the initialization process if
        # there are many new providers added. Should think of a
        # different solution
        try:
            provider.initializeSettings()
            Processing.providers.append(provider)
            ProcessingConfig.loadSettings()
            if updateList:
                Processing.updateAlgsList()
        except:
            ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
                                   'Could not load provider:'
                                   + provider.getDescription() + '\n'
                                   + unicode(sys.exc_info()[1]))
            Processing.removeProvider(provider)
Beispiel #8
0
 def initialize():
     #add the basic providers
     Processing.addProvider(QGISAlgorithmProvider())
     Processing.addProvider(ModelerOnlyAlgorithmProvider())
     Processing.addProvider(GdalOgrAlgorithmProvider())
     Processing.addProvider(LidarToolsAlgorithmProvider())
     Processing.addProvider(OTBAlgorithmProvider())
     Processing.addProvider(RAlgorithmProvider())
     Processing.addProvider(SagaAlgorithmProvider())
     Processing.addProvider(GrassAlgorithmProvider())
     Processing.addProvider(ScriptAlgorithmProvider())
     Processing.addProvider(TauDEMAlgorithmProvider())
     Processing.addProvider(AdminToolsAlgorithmProvider())
     Processing.modeler.initializeSettings();
     #and initialize
     AlgorithmDecorator.loadClassification()
     ProcessingLog.startLogging()
     ProcessingConfig.initialize()
     ProcessingConfig.loadSettings()
     RenderingStyles.loadStyles()
     Processing.loadFromProviders()
Beispiel #9
0
    def initialize():
        # Add the basic providers
        Processing.addProvider(QGISAlgorithmProvider())
        Processing.addProvider(ModelerOnlyAlgorithmProvider())
        Processing.addProvider(GdalOgrAlgorithmProvider())
        Processing.addProvider(LidarToolsAlgorithmProvider())
        Processing.addProvider(OTBAlgorithmProvider())
        Processing.addProvider(RAlgorithmProvider())
        Processing.addProvider(SagaAlgorithmProvider())
        Processing.addProvider(GrassAlgorithmProvider())
        Processing.addProvider(ScriptAlgorithmProvider())
        Processing.addProvider(TauDEMAlgorithmProvider())
        Processing.addProvider(AdminToolsAlgorithmProvider())
        Processing.modeler.initializeSettings()

        # And initialize
        AlgorithmDecorator.loadClassification()
        ProcessingLog.startLogging()
        ProcessingConfig.initialize()
        ProcessingConfig.loadSettings()
        RenderingStyles.loadStyles()
        Processing.loadFromProviders()