Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adapt “@qgsfunction" decorator to new expression structure
  • Loading branch information
m-kuhn committed May 19, 2017
1 parent e02cd57 commit 1e4c159
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/core/__init__.py
Expand Up @@ -71,10 +71,10 @@ def myfunc(values, *args):
:param usesgeometry:
:return:
"""
class QgsExpressionFunction(QgsExpression.Function):
class QgsPyExpressionFunction(QgsExpressionFunction):

def __init__(self, func, name, args, group, helptext='', usesGeometry=True, referencedColumns=QgsFeatureRequest.ALL_ATTRIBUTES, expandargs=False):
QgsExpression.Function.__init__(self, name, args, group, helptext)
QgsExpressionFunction.__init__(self, name, args, group, helptext)
self.function = func
self.expandargs = expandargs
self.uses_geometry = usesGeometry
Expand Down Expand Up @@ -132,7 +132,7 @@ def referencedColumns(self, node):

function.__name__ = name
helptext = helptemplate.safe_substitute(name=name, doc=helptext)
f = QgsExpressionFunction(function, name, arg_count, group, helptext, usesgeometry, referenced_columns, expandargs)
f = QgsPyExpressionFunction(function, name, arg_count, group, helptext, usesgeometry, referenced_columns, expandargs)

# This doesn't really make any sense here but does when used from a decorator context
# so it can stay.
Expand Down

0 comments on commit 1e4c159

Please sign in to comment.