owners for multi options

This commit is contained in:
gwen 2012-12-11 16:22:02 +01:00
parent cda5d8c0bd
commit e70054c4d4
1 changed files with 3 additions and 3 deletions

View File

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