Skip to content
Permalink
Browse files
Convert QgsTask.fromFunction to a static method
  • Loading branch information
nyalldawson committed Dec 5, 2016
1 parent 619381c commit 29f310c0706c3fbd7bb7f91241b048412ae3efe6
Showing with 3 additions and 2 deletions.
  1. +3 −2 python/core/__init__.py
@@ -234,8 +234,9 @@ def finished(self, result):
self.exception = ex


def fromFunction(cls, description, function, *args, on_finished=None, flags=QgsTask.AllFlags, **kwargs):
@staticmethod
def fromFunction(description, function, *args, on_finished=None, flags=QgsTask.AllFlags, **kwargs):
assert function
return QgsTaskWrapper(description, flags, function, on_finished, *args, **kwargs)

QgsTask.fromFunction = classmethod(fromFunction)
QgsTask.fromFunction = fromFunction

0 comments on commit 29f310c

Please sign in to comment.