Merge branch 'master' into orm
[tiramisu.git] / tiramisu / value.py
index 8c50373..c969291 100644 (file)
@@ -134,7 +134,7 @@ class Values(object):
         :type index: int
         :returns: a calculated value
         """
-        callback, callback_params = opt._callback
+        callback, callback_params = opt.impl_get_callback()
         if callback_params is None:
             callback_params = {}
         return carry_out_calculation(opt, config=self.context(),
@@ -415,7 +415,7 @@ class Multi(list):
                                     is_default_owner):
             raise SlaveError(_("invalid len for the slave: {0}"
                                " which has {1} as master").format(
-                                   self.opt._name, masterp))
+                                   self.opt.impl_getname(), masterp))
         elif valuelen < masterlen:
             for num in range(0, masterlen - valuelen):
                 if self.opt.impl_has_callback():
@@ -440,7 +440,7 @@ class Multi(list):
                     raise SlaveError(_("invalid len for the master: {0}"
                                        " which has {1} as slave with"
                                        " greater len").format(
-                                           self.opt._name, slave._name))
+                                           self.opt.impl_getname(), slave.impl_getname()))
                 elif len(value_slave) < masterlen:
                     for num in range(0, masterlen - len(value_slave)):
                         if slave.impl_has_callback():
@@ -467,7 +467,7 @@ class Multi(list):
         if not force:
             if self.opt.impl_get_multitype() == multitypes.slave:
                 raise SlaveError(_("cannot append a value on a multi option {0}"
-                                   " which is a slave").format(self.opt._name))
+                                   " which is a slave").format(self.opt.impl_getname()))
             elif self.opt.impl_get_multitype() == multitypes.master:
                 values = self.context().cfgimpl_get_values()
                 if value is undefined and self.opt.impl_has_callback():
@@ -506,7 +506,7 @@ class Multi(list):
         if self.opt.impl_get_multitype() in [multitypes.slave,
                                              multitypes.master]:
             raise SlaveError(_("cannot sort multi option {0} if master or slave"
-                               "").format(self.opt._name))
+                               "").format(self.opt.impl_getname()))
         if sys.version_info[0] >= 3:
             if cmp is not None:
                 raise ValueError(_('cmp is not permitted in python v3 or greater'))
@@ -519,7 +519,7 @@ class Multi(list):
         if self.opt.impl_get_multitype() in [multitypes.slave,
                                              multitypes.master]:
             raise SlaveError(_("cannot reverse multi option {0} if master or "
-                               "slave").format(self.opt._name))
+                               "slave").format(self.opt.impl_getname()))
         super(Multi, self).reverse()
         self.context().cfgimpl_get_values()._setvalue(self.opt, self.path, self)
 
@@ -527,7 +527,7 @@ class Multi(list):
         if self.opt.impl_get_multitype() in [multitypes.slave,
                                              multitypes.master]:
             raise SlaveError(_("cannot insert multi option {0} if master or "
-                               "slave").format(self.opt._name))
+                               "slave").format(self.opt.impl_getname()))
         super(Multi, self).insert(index, obj)
         self.context().cfgimpl_get_values()._setvalue(self.opt, self.path, self)
 
@@ -535,7 +535,7 @@ class Multi(list):
         if self.opt.impl_get_multitype() in [multitypes.slave,
                                              multitypes.master]:
             raise SlaveError(_("cannot extend multi option {0} if master or "
-                               "slave").format(self.opt._name))
+                               "slave").format(self.opt.impl_getname()))
         super(Multi, self).extend(iterable)
         self.context().cfgimpl_get_values()._setvalue(self.opt, self.path, self)
 
@@ -548,7 +548,7 @@ class Multi(list):
                 raise ValueError(_("invalid value {0} "
                                    "for option {1}: {2}"
                                    "").format(str(value),
-                                              self.opt._name, err))
+                                              self.opt.impl_getname(), err))
 
     def pop(self, index, force=False):
         """the list value can be updated (poped)
@@ -563,7 +563,7 @@ class Multi(list):
         if not force:
             if self.opt.impl_get_multitype() == multitypes.slave:
                 raise SlaveError(_("cannot pop a value on a multi option {0}"
-                                   " which is a slave").format(self.opt._name))
+                                   " which is a slave").format(self.opt.impl_getname()))
             elif self.opt.impl_get_multitype() == multitypes.master:
                 for slave in self.opt.impl_get_master_slaves():
                     values = self.context().cfgimpl_get_values()