owners for multi options

This commit is contained in:
gwen 2012-12-11 16:22:02 +01:00
parent cda5d8c0bd
commit e70054c4d4

View File

@ -99,15 +99,15 @@ class Multi(list):
if not self.opt._validate(value):
raise ConfigError("invalid value {0} "
"for option {1}".format(str(value), self.opt._name))
if not isinstance(who, owners.Owner):
raise TypeError("invalid owner {0} for the value {1}".format(
str(who), str(value)))
oldvalue = list(self)
if key is None:
ret = super(Multi, self).append(value)
else:
ret = super(Multi, self).__setitem__(key, value)
if who != None:
if not isinstance(who, owners.Owner):
raise TypeError("invalid owner {0} for the value {1}".format(
str(who), str(value)))
self.opt.setowner(self.config, getattr(owners, who))
self.config._cfgimpl_previous_values[self.opt._name] = oldvalue
return ret