[config] Refactoring of configurables, allowing partially configured objects.

Configurables did not allow more than one "method" option, and mixed
scenarios (options+methods+...) were sometimes flaky, forcing the user
to know what order was the right one. Now, all options work the same,
sharing the same "order" namespace.

Backward incompatible change: Options are now required by default,
unless a default is provided.

Also adds a few candies for debugging/testing, found in the
bonobo.util.inspect module.
This commit is contained in:
Romain Dorgueil
2017-07-05 11:15:03 +02:00
parent 67b4227436
commit 5062221e78
19 changed files with 573 additions and 120 deletions

View File

@ -27,7 +27,7 @@ class Setting:
self.validator = None
def __repr__(self):
return '<Setting {}={!r}>'.format(self.name, self.value)
return '<Setting {}={!r}>'.format(self.name, self.get())
def set(self, value):
if self.validator and not self.validator(value):