Skip to content
Permalink
Browse files

[processing] improvements for new mechanism for adding algorithms

Correctly remove algorithms on plugin unload
  • Loading branch information
volaya committed May 24, 2016
1 parent bc75862 commit 3607e269c6695eedc3cfe6285344905062125d32
@@ -32,7 +32,7 @@
class ProcessingExampleScriptsPlugin:

def initGui(self):
Processing.addScripts(self, os.path.dirname(__file__))
Processing.addScripts(os.path.join(os.path.dirname(__file__), "scripts"))

def unload(self):
pass
Processing.removeScripts(os.path.join(os.path.dirname(__file__), "scripts"))
@@ -150,9 +150,16 @@ def addScripts(folder):
provider.externalAlgs.extend(scripts)
Processing.reloadProvider("qgis")

@staticmethod

@staticmethod
def removeScripts(folder):
pass
provider = Processing.getProviderFromName("qgis")
for alg in provider.externalAlgs[::-1]:
path = os.path.dirname(alg.descriptionFile)
if path == folder:
provider.externalAlgs.remove(alg)
Processing.reloadProvider("qgis")


@staticmethod
def updateAlgsList():

0 comments on commit 3607e26

Please sign in to comment.
You can’t perform that action at this time.