abstraction on scheduler
This commit is contained in:
parent
e66f47e3fb
commit
3393fb73e9
7 changed files with 64 additions and 14 deletions
|
|
@ -57,9 +57,11 @@ class Backend:
|
|||
raise Backend.ConfigError("Value of '%s' does not match regexp '%s'" % (name, field.regexp))
|
||||
|
||||
if not field.default is None:
|
||||
if isinstance(field.default, int):
|
||||
if isinstance(field.default, bool):
|
||||
value = value.lower() in ('1', 'true', 'on', 'yes')
|
||||
elif isinstance(field.default, int):
|
||||
value = int(value)
|
||||
if isinstance(field.default, float):
|
||||
elif isinstance(field.default, float):
|
||||
value = float(value)
|
||||
self.config[name] = value
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue