From 184c48db8ca86b5782c0096c60a09ec6be2a23fc Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Wed, 30 Jan 2013 18:03:15 +0100 Subject: [PATCH] Do not append default value on already defined multi slaves * tiramisu/option.py (Multi.append): append the default value when the slaves have no item or lesser than the master. Divide looping over slaves by factor 2. Fixes: #4799 @4h --- tiramisu/option.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tiramisu/option.py b/tiramisu/option.py index 8cb6638..540fd2e 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -82,13 +82,14 @@ class Multi(list): self._setvalue(value, who=settings.get_owner()) multis = [] for opt in self.config._cfgimpl_descr._children: + if isinstance(opt, OptionDescription): + continue multi = self.config._cfgimpl_values[opt._name] - multis.append(multi) - for multi in multis: if master == multi.opt._name: if add_master: multi._setvalue(value, who=settings.get_owner()) - else: + elif len(multi) == 0 \ + or len(multi) < len(self): multi._append_default() def _append_default(self):