Made AsyncModalOperatorMixin.invoke() start self.async_execute(context).

This was already common practice in all subclasses, and has now been
moved into the mixin.
This commit is contained in:
2016-08-26 17:06:32 +02:00
parent f41ea8c5a3
commit 143456ae1d
4 changed files with 14 additions and 21 deletions

View File

@@ -182,8 +182,19 @@ class AsyncModalOperatorMixin:
def invoke(self, context, event):
context.window_manager.modal_handler_add(self)
self.timer = context.window_manager.event_timer_add(1 / 15, context.window)
self.log.info('Starting')
self._new_async_task(self.async_execute(context))
return {'RUNNING_MODAL'}
async def async_execute(self, context):
"""Entry point of the asynchronous operator.
Implement in a subclass.
"""
return
def execute(self, context):
return self.invoke(context, None)