tiramisu/value.py : self.opt => opt + disable permissive in read_write mode
authorEmmanuel Garette <egarette@cadoles.com>
Wed, 3 Apr 2013 15:05:41 +0000 (17:05 +0200)
committerEmmanuel Garette <egarette@cadoles.com>
Wed, 3 Apr 2013 15:05:41 +0000 (17:05 +0200)
tiramisu/setting.py
tiramisu/value.py

index 1c1e8db..90918f0 100644 (file)
@@ -242,4 +242,4 @@ class Setting(object):
         self.enable_property('disabled')
         self.disable_property('mandatory')
         self.disable_property('validator')
         self.enable_property('disabled')
         self.disable_property('mandatory')
         self.disable_property('validator')
-        self.enable_property('permissive')
+        self.disable_property('permissive')
index 24b268d..9f9e4d6 100644 (file)
@@ -160,7 +160,7 @@ class Values(object):
         if opt.is_multi():
             if opt.multitype == multitypes.master:
                 masterlen = len(value)
         if opt.is_multi():
             if opt.multitype == multitypes.master:
                 masterlen = len(value)
-                for slave in self.opt.master_slaves:
+                for slave in opt.master_slaves:
                     value_slave = self._get_value(slave)
                     if len(value_slave) > masterlen:
                         raise MultiTypeError("invalid len for the slave: {0}"
                     value_slave = self._get_value(slave)
                     if len(value_slave) > masterlen:
                         raise MultiTypeError("invalid len for the slave: {0}"
@@ -171,10 +171,10 @@ class Values(object):
                             value_slave.append(None, force=True)
 
             elif opt.multitype == multitypes.slave:
                             value_slave.append(None, force=True)
 
             elif opt.multitype == multitypes.slave:
-                if len(self._get_value(self.opt.master_slaves)) != len(value):
+                if len(self._get_value(opt.master_slaves)) != len(value):
                     raise MultiTypeError("invalid len for the slave: {0}"
                                          " which has {1} as master".format(
                     raise MultiTypeError("invalid len for the slave: {0}"
                                          " which has {1} as master".format(
-                                             opt._name, self.opt.master_slaves._name))
+                                             opt._name, opt.master_slaves._name))
             if not isinstance(value, Multi):
                 value = Multi(value, self.context, opt)
         self.setitem(opt, value)
             if not isinstance(value, Multi):
                 value = Multi(value, self.context, opt)
         self.setitem(opt, value)