[engine] Small bugfix if no IDs are configured

see #547
This commit is contained in:
Tobias Witek 2020-02-14 21:52:23 +01:00
parent ef35c957b2
commit 65137f294e

View file

@ -295,11 +295,14 @@ class Engine(object):
self._current_module = module self._current_module = module
module.update_wrapper(module.widgets()) module.update_wrapper(module.widgets())
if module.error is None: if module.error is None:
widget_ids = module.parameter('id', '').split(',') widget_ids = []
if module.parameter('id'):
widget_ids = module.parameter('id').split(',')
idx = 0 idx = 0
for widget in module.widgets(): for widget in module.widgets():
widget.link_module(module) widget.link_module(module)
widget.id = widget_ids[idx] if idx < len(widget_ids) else widget.id if idx < len(widget_ids):
widget.id = widget_ids[idx]
idx = idx + 1 idx = idx + 1
self._output.draw(widget=widget, module=module, engine=self) self._output.draw(widget=widget, module=module, engine=self)
else: else: