:param context: :return: """ self.setup(*context) yield self self.teardown() def resolve_processors(mixed): try: yield from mixed.__processors__ except AttributeError: yield from () get_context_processors = deprecated_alias('get_context_processors', resolve_processors) def use_context(f): def context(self, context, *args, **kwargs): yield context return use_context_processor(context)(f) def use_context_processor(context_processor): def using_context_processor(cls_or_func): nonlocal context_processor try: cls_or_func.__processors__
from bonobo.config.configurables import Configurable from bonobo.config.functools import transformation_factory from bonobo.config.options import Method, Option from bonobo.config.processors import ContextProcessor, use_context, use_context_processor, use_raw_input, use_no_input from bonobo.config.services import Container, Exclusive, Service, use, create_container from bonobo.util import deprecated_alias requires = deprecated_alias('requires', use) # Bonobo's Config API __all__ = [ 'Configurable', 'Container', 'ContextProcessor', 'Exclusive', 'Method', 'Option', 'Service', 'create_container', 'requires', 'transformation_factory', 'use', 'use_context', 'use_context_processor', 'use_no_input', 'use_raw_input', ]
""" The Config API, located under the :mod:`bonobo.config` namespace, contains all the tools you need to create configurable transformations, either class-based or function-based. """ from bonobo.config.configurables import Configurable from bonobo.config.functools import transformation_factory from bonobo.config.options import Method, Option from bonobo.config.processors import ContextProcessor, use_context, use_context_processor, use_raw_input, use_no_input from bonobo.config.services import Container, Exclusive, Service, use, create_container from bonobo.util import deprecated_alias requires = deprecated_alias('requires', use) # Bonobo's Config API __all__ = [ 'Configurable', 'Container', 'ContextProcessor', 'Exclusive', 'Method', 'Option', 'Service', 'create_container', 'requires', 'transformation_factory', 'use', 'use_context', 'use_context_processor', 'use_no_input',
""" The Config API, located under the :mod:`bonobo.config` namespace, contains all the tools you need to create configurable transformations, either class-based or function-based. """ from bonobo.config.configurables import Configurable from bonobo.config.functools import partial, transformation_factory from bonobo.config.options import Method, Option from bonobo.config.processors import ContextProcessor, use_context, use_context_processor, use_no_input, use_raw_input from bonobo.config.services import Container, Exclusive, Service, create_container, use from bonobo.util import deprecated_alias requires = deprecated_alias("requires", use) # Bonobo's Config API __all__ = [ "Configurable", "Container", "ContextProcessor", "Exclusive", "Method", "Option", "Service", "create_container", "partial", "requires", "transformation_factory", "use", "use_context", "use_context_processor",
:param context: :return: """ self.setup(*context) yield self self.teardown() def resolve_processors(mixed): try: yield from mixed.__processors__ except AttributeError: yield from () get_context_processors = deprecated_alias("get_context_processors", resolve_processors) def use_context(f): def context(self, context, *args, **kwargs): yield context return use_context_processor(context)(f) def use_context_processor(context_processor): def using_context_processor(cls_or_func): nonlocal context_processor try: cls_or_func.__processors__