From 4e2cb29fc2a5137123a6f9e4be0d870f083aa068 Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Sun, 22 Jul 2018 07:54:22 +0200 Subject: [PATCH] Formatting. --- bonobo/config/configurables.py | 1 + bonobo/execution/contexts/node.py | 14 +++++++++++--- bonobo/registry.py | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bonobo/config/configurables.py b/bonobo/config/configurables.py index 98e21e7..81defaa 100644 --- a/bonobo/config/configurables.py +++ b/bonobo/config/configurables.py @@ -77,6 +77,7 @@ except ImportError: PartiallyConfigured = functools.partial else: + class PartiallyConfigured(_functools.partial): @property # TODO XXX cache this def _options_values(self): diff --git a/bonobo/execution/contexts/node.py b/bonobo/execution/contexts/node.py index 0affd29..c8d7733 100644 --- a/bonobo/execution/contexts/node.py +++ b/bonobo/execution/contexts/node.py @@ -30,6 +30,7 @@ class NodeExecutionContext(BaseContext, WithStatistics): a service implementation, or a value holder). """ + def __init__(self, wrapped, *, parent=None, services=None, _input=None, _outputs=None): """ Node execution context has the responsibility fo storing the state of a transformation during its execution. @@ -92,11 +93,15 @@ class NodeExecutionContext(BaseContext, WithStatistics): # Not normal to have a partially configured object here, so let's warn the user instead of having get into # the hard trouble of understanding that by himself. raise TypeError( - 'Configurables should be instanciated before execution starts.\nGot {!r}.\n'.format(self.wrapped) + 'Configurables should be instanciated before execution starts.\nGot {!r}.\n'.format( + self.wrapped + ) ) from exc else: raise TypeError( - 'Configurables should be instanciated before execution starts.\nGot {!r}.\n'.format(self.wrapped) + 'Configurables should be instanciated before execution starts.\nGot {!r}.\n'.format( + self.wrapped + ) ) self._stack.setup(self) except Exception: @@ -128,7 +133,10 @@ class NodeExecutionContext(BaseContext, WithStatistics): self._step() except InactiveReadableError: raise - except (NotImplementedError, UnrecoverableError, ): + except ( + NotImplementedError, + UnrecoverableError, + ): self.fatal(sys.exc_info()) # exit loop except Exception: # pylint: disable=broad-except self.error(sys.exc_info()) # does not exit loop diff --git a/bonobo/registry.py b/bonobo/registry.py index fba0c53..f45da4f 100644 --- a/bonobo/registry.py +++ b/bonobo/registry.py @@ -89,6 +89,7 @@ class Registry: default_registry = Registry() + def create_reader(name, *args, format=None, registry=default_registry, **kwargs): """ Create a reader instance, guessing its factory using filename (and eventually format). @@ -103,6 +104,7 @@ def create_reader(name, *args, format=None, registry=default_registry, **kwargs) """ return registry.get_reader_factory_for(name, format=format)(name, *args, **kwargs) + def create_writer(name, *args, format=None, registry=default_registry, **kwargs): """ Create a writer instance, guessing its factory using filename (and eventually format).