comparison src/memory/params.py @ 1745:5ca3caefcf98

core (params): removed unused values
author Goffi <goffi@goffi.org>
date Tue, 15 Dec 2015 16:25:37 +0100
parents 9a48e09044eb
children 40b7f18ac704
comparison
equal deleted inserted replaced
1744:9a48e09044eb 1745:5ca3caefcf98
371 if node.getAttribute('type') == 'int': 371 if node.getAttribute('type') == 'int':
372 return int(value_to_use) 372 return int(value_to_use)
373 elif node.getAttribute('type') == 'list': 373 elif node.getAttribute('type') == 'list':
374 assert not value_to_use # only accept <option selected...> and not <param value...> 374 assert not value_to_use # only accept <option selected...> and not <param value...>
375 options = [option for option in node.childNodes if option.nodeName == 'option'] 375 options = [option for option in node.childNodes if option.nodeName == 'option']
376 values = [option.getAttribute('value') for option in options]
377 selected = [option for option in options if option.getAttribute('selected') == 'true'] 376 selected = [option for option in options if option.getAttribute('selected') == 'true']
378 cat, param = node.parentNode.getAttribute('name'), node.getAttribute('name') 377 cat, param = node.parentNode.getAttribute('name'), node.getAttribute('name')
379 if len(selected) == 1: 378 if len(selected) == 1:
380 value_to_use = selected[0].getAttribute('value') 379 value_to_use = selected[0].getAttribute('value')
381 log.info(_("Unset parameter (%(cat)s, %(param)s) of type list will use the default option '%(value)s'") % 380 log.info(_("Unset parameter (%(cat)s, %(param)s) of type list will use the default option '%(value)s'") %