starting to write docs, taking decisions on public api
This commit is contained in:
@ -4,12 +4,16 @@ import functools
|
||||
import pprint
|
||||
|
||||
from .tokens import NOT_MODIFIED
|
||||
from .helpers import run, console_run, jupyter_run
|
||||
|
||||
__all__ = [
|
||||
'NOT_MODIFIED',
|
||||
'console_run',
|
||||
'head',
|
||||
'jupyter_run',
|
||||
'log',
|
||||
'noop',
|
||||
'run',
|
||||
'tee',
|
||||
]
|
||||
|
||||
|
||||
20
bonobo/util/helpers.py
Normal file
20
bonobo/util/helpers.py
Normal file
@ -0,0 +1,20 @@
|
||||
def run(*chain, plugins=None):
|
||||
from bonobo import Graph, ThreadPoolExecutorStrategy
|
||||
|
||||
graph = Graph()
|
||||
graph.add_chain(*chain)
|
||||
|
||||
executor = ThreadPoolExecutorStrategy()
|
||||
return executor.execute(graph, plugins=plugins or [])
|
||||
|
||||
|
||||
def console_run(*chain, output=True, plugins=None):
|
||||
from bonobo.ext.console import ConsoleOutputPlugin
|
||||
|
||||
return run(*chain, plugins=(plugins or []) + [ConsoleOutputPlugin()] if output else [])
|
||||
|
||||
|
||||
def jupyter_run(*chain, plugins=None):
|
||||
from bonobo.ext.jupyter import JupyterOutputPlugin
|
||||
|
||||
return run(*chain, plugins=(plugins or []) + [JupyterOutputPlugin()])
|
||||
Reference in New Issue
Block a user