Note reasoning behind call order

This commit is contained in:
gandalf3
2017-07-09 14:57:22 -07:00
committed by Ellwood Zwovic
parent 32f0d9fdb6
commit a4a1f69cd1

View File

@@ -32,14 +32,17 @@ def subprocess_operator(cls: Operator, polling_interval=.01) -> Operator:
call_copy_of_method_if_exist(cls, 'execute', self, context) call_copy_of_method_if_exist(cls, 'execute', self, context)
return self.invoke(context, None) return self.invoke(context, None)
return execute return execute
def decorate_invoke(orig_invoke): def decorate_invoke(orig_invoke):
""" """
Create pipe and modal timer, start subprocess Create pipe and modal timer, start subprocess
""" """
def invoke(self, context, event): def invoke(self, context, event):
self.pipe = Pipe() self.pipe = Pipe() #HACK: do this first so operator-defined invoke can access it
# this is needed because the operator is currently responsible for setting up the Process,
# and the pipe is needed for the subprocess_function decorator.
# TODO: Perhaps this responsibility should be handled here instead (simplifies things but looses some flexibility)
orig_invoke(self, context, event) orig_invoke(self, context, event)