Starting to work on #47 a.k.a the context processor mess. This is a first implementation removing all the uggly function calls, but further work must work on less things called "context", as it is bad for readability. Concerns better separated now.

This commit is contained in:
Romain Dorgueil
2017-05-01 18:27:27 +02:00
parent 32bf13c77d
commit 4154d7e3d8
12 changed files with 152 additions and 75 deletions

View File

@ -1,4 +1,4 @@
from bonobo.config.processors import contextual
from bonobo.config.processors import ContextProcessor
from bonobo.constants import BEGIN, END
from bonobo.execution.graph import GraphExecutionContext
from bonobo.strategies import NaiveStrategy
@ -13,12 +13,11 @@ def square(i: int) -> int:
return i**2
@contextual
def push_result(results, i: int):
results.append(i)
@push_result.__processors__.append
@ContextProcessor.decorate(push_result)
def results(f, context):
results = []
yield results