Skip to content

Commit

Permalink
Convert QgsTask.fromFunction to a static method
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 5, 2016
1 parent 619381c commit 29f310c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/core/__init__.py
Expand Up @@ -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.