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)