support submulti with follower

This commit is contained in:
2020-04-21 09:22:45 +02:00
parent 308e980bfd
commit d47d1fde62
79 changed files with 192 additions and 10 deletions

View File

@ -385,18 +385,21 @@ class Variable(Common):
if 'default' not in self.attrib:
self.attrib['default'] = []
value = convert_tiramisu_value(child.text, type_)
if not isinstance(value, list) and not is_follower:
value = [value]
self.attrib['default'].append(value)
if 'default_multi' not in self.attrib and not is_leader:
self.attrib['default_multi'] = value
if not is_follower:
if not isinstance(value, list):
dvalue = [value]
else:
dvalue = value
self.attrib['default'].append(dvalue)
if value and 'default_multi' not in self.attrib and not is_leader:
self.attrib['default_multi'] = []
if not is_leader:
self.attrib['default_multi'].append(value)
else:
if 'default' in self.attrib:
raise CreoleLoaderError(_('default value already set for {}'
'').format(self.attrib['path']))
value = convert_tiramisu_value(child.text, type_)
if value is None: # and (elt.attrib['type'] != 'choice' or value not in self.attrib['values']):
value = u''
if is_follower:
self.attrib['default_multi'] = value
else: