Skip to content

Commit

Permalink
Add some more clone methods to algorithm subclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 6, 2017
1 parent 0c6b19c commit 1b2afea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/qgis/QgisAlgorithm.py
Expand Up @@ -47,3 +47,6 @@ def trAlgorithm(self, string, context=''):
if context == '':
context = self.__class__.__name__
return string, QCoreApplication.translate(context, string)

def clone(self):
return type(self)()
3 changes: 3 additions & 0 deletions python/plugins/processing/tests/QgisAlgorithmsTest.py
Expand Up @@ -48,6 +48,9 @@ def name(self):
def displayName(self):
return 'testalg'

def clone(self):
return TestAlg()

def processAlgorithm(self, parameters, context, feedback):
raise GeoAlgorithmExecutionException('Exception while processing')
return {}
Expand Down

0 comments on commit 1b2afea

Please sign in to comment.