option's name shall not have an api's method name
[tiramisu.git] / tiramisu / value.py
index 07236d5..74adc5b 100644 (file)
@@ -20,7 +20,7 @@
 # the rough pypy's guys: http://codespeak.net/svn/pypy/dist/pypy/config/
 # the whole pypy projet is under MIT licence
 # ____________________________________________________________
 # the rough pypy's guys: http://codespeak.net/svn/pypy/dist/pypy/config/
 # the whole pypy projet is under MIT licence
 # ____________________________________________________________
-from tiramisu.error import NoValueReturned, MandatoryError
+from tiramisu.error import NoValueReturned, MandatoryError, MultiTypeError
 from tiramisu.setting import owners, multitypes
 
 class Values(object):
 from tiramisu.setting import owners, multitypes
 
 class Values(object):
@@ -138,16 +138,16 @@ class Values(object):
     def __setitem__(self, opt, value):
         if opt in self.masters:
             masterlen = len(value)
     def __setitem__(self, opt, value):
         if opt in self.masters:
             masterlen = len(value)
-            for slave in masters[opt]:
+            for slave in self.masters[opt]:
                 if len(self._get_value(slave)) != masterlen:
                     raise MultiTypeError("invalid len for the slave: {0}"
                 if len(self._get_value(slave)) != masterlen:
                     raise MultiTypeError("invalid len for the slave: {0}"
-                    "which has {1} as master".format(slave._name,
-                                                     master._name))
+                    " which has {1} as master".format(slave._name,
+                                                      opt._name))
         elif opt in self.slaves:
             if len(self._get_value(self.slaves[opt])) != len(value):
                    raise MultiTypeError("invalid len for the slave: {0}"
         elif opt in self.slaves:
             if len(self._get_value(self.slaves[opt])) != len(value):
                    raise MultiTypeError("invalid len for the slave: {0}"
-                    "which has {1} as master".format(slave._name,
-                                                     master._name))
+                    " which has {1} as master".format(opt._name,
+                                                      self.slaves[opt]._name))
         self.setitem(opt, value)
 
     def setitem(self, opt, value):
         self.setitem(opt, value)
 
     def setitem(self, opt, value):