[core] Refactoring of commands to move towards a more pythonic way of running the jobs. Commands are now classes, and bonobo "graph" related commands now hooks into bonobo.run() calls so it will use what you actually put in your __main__ block.

This commit is contained in:
Romain Dorgueil
2017-10-29 19:23:50 +01:00
parent cac6920040
commit 8351897e3a
26 changed files with 483 additions and 371 deletions

View File

@ -51,6 +51,12 @@ class Setting:
raise ValidationError('Invalid value {!r} for setting {}.'.format(value, self.name))
self.value = value
def set_if_true(self, value):
"""Sets the value to true if it is actually true. May sound strange but the main usage is enforcing some
settings from command line."""
if value:
self.set(True)
def get(self):
try:
return self.value