From a4a1f69cd152de1ac41f9b3a1b55d487eb86f7d8 Mon Sep 17 00:00:00 2001 From: gandalf3 Date: Sun, 9 Jul 2017 14:57:22 -0700 Subject: [PATCH] Note reasoning behind call order --- subprocess_adapter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subprocess_adapter.py b/subprocess_adapter.py index 2156d7e..0a04def 100644 --- a/subprocess_adapter.py +++ b/subprocess_adapter.py @@ -32,14 +32,17 @@ def subprocess_operator(cls: Operator, polling_interval=.01) -> Operator: call_copy_of_method_if_exist(cls, 'execute', self, context) return self.invoke(context, None) return execute - + def decorate_invoke(orig_invoke): """ Create pipe and modal timer, start subprocess """ 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)