list is Multi now which enables us to implement item access
This commit is contained in:
parent
ce56100602
commit
05f5b0ccbc
11
option.py
11
option.py
|
@ -46,15 +46,22 @@ class Multi(list):
|
|||
return self.child.default_multi
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
if value is None:
|
||||
owner = 'default'
|
||||
else:
|
||||
owner = default_owner
|
||||
self.child.setowner(self.config, owner)
|
||||
if value != None and not self.child._validate(value):
|
||||
raise ConfigError("invalid value {0} "
|
||||
"for option {1}".format(str(value), self.child._name))
|
||||
# FIXME : and if value is None ???
|
||||
return super(Multi, self).__setitem__(key, value)
|
||||
|
||||
def append(self, value, owner=default_owner):
|
||||
if owner is None:
|
||||
def append(self, value):
|
||||
if value is None:
|
||||
owner = 'default'
|
||||
else:
|
||||
owner = default_owner
|
||||
self.child.setowner(self.config, owner)
|
||||
# changer dans la config la valeur par défaut et le owner
|
||||
if value != None and not self.child._validate(value):
|
||||
|
|
Loading…
Reference in New Issue