Commit 166ec858 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_prototype: No need tot explicitly add _list of multiple type propertiesd

parent 5a2410f2
...@@ -970,15 +970,16 @@ class ObjectPropertyTemplatePackageItem(Implicit, Persistent): ...@@ -970,15 +970,16 @@ class ObjectPropertyTemplatePackageItem(Implicit, Persistent):
LOG('Business Template', 0, 'Skipping file "%s"' % (file_name, )) LOG('Business Template', 0, 'Skipping file "%s"' % (file_name, ))
return return
xml = parse(file) xml = parse(file)
multiple_type = ('lines', 'selection', 'multiple selection')
object_list = xml.findall('object') object_list = xml.findall('object')
for obj in object_list: for obj in object_list:
for obj_property in obj.findall('property'): for obj_property in obj.findall('property'):
item_list = [] item_list = []
for item in obj_property.findall('item'): for item in obj_property.findall('item'):
item_list.append(item.text) item_list.append(item.text)
property_name = obj_property.find('name').text + ('' if len(item_list) <= 1 else '_list') property_name = obj_property.find('name').text
property_type = obj_property.find('type').text property_type = obj_property.find('type').text
if property_type not in ('lines', 'selection', 'multiple selection'): if property_type not in multiple_type:
try: try:
item_list = item_list[0] item_list = item_list[0]
except IndexError: except IndexError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment