Add some more clone methods to algorithm subclasses

This commit is contained in:
Nyall Dawson 2017-06-27 13:45:22 +10:00
parent 0c6b19cd85
commit 1b2afea23e
2 changed files with 6 additions and 0 deletions

View File

@ -47,3 +47,6 @@ class QgisAlgorithm(QgsProcessingAlgorithm):
if context == '':
context = self.__class__.__name__
return string, QCoreApplication.translate(context, string)
def clone(self):
return type(self)()

View File

@ -48,6 +48,9 @@ class TestAlg(QgsProcessingAlgorithm):
def displayName(self):
return 'testalg'
def clone(self):
return TestAlg()
def processAlgorithm(self, parameters, context, feedback):
raise GeoAlgorithmExecutionException('Exception while processing')
return {}