comparison sat_pubsub/backend.py @ 336:a468c187bbb5

fixed parseItemConfig (was iterating on children instead of elements)
author Goffi <goffi@goffi.org>
date Sat, 12 Aug 2017 18:10:14 +0200
parents 0fcd0ea89c84
children 516b282aa542
comparison
equal deleted inserted replaced
335:5580f08c7b91 336:a468c187bbb5
252 @param item (domish.Element): item to parse 252 @param item (domish.Element): item to parse
253 @return (tuple[unicode, dict)): (access_model, item_config) 253 @return (tuple[unicode, dict)): (access_model, item_config)
254 """ 254 """
255 item_config = None 255 item_config = None
256 access_model = const.VAL_AMODEL_DEFAULT 256 access_model = const.VAL_AMODEL_DEFAULT
257 for idx, elt in enumerate(item.children): 257 for idx, elt in enumerate(item.elements()):
258 if elt.uri != 'data_form.NS_X_DATA' or elt.name != 'x': 258 if elt.uri != 'data_form.NS_X_DATA' or elt.name != 'x':
259 continue 259 continue
260 form = data_form.Form.fromElement(elt) 260 form = data_form.Form.fromElement(elt)
261 if form.formNamespace == const.NS_ITEM_CONFIG: 261 if form.formNamespace == const.NS_ITEM_CONFIG:
262 item_config = form 262 item_config = form