[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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user