Mercurial > libervia-backend
comparison src/tools/xml_tools.py @ 876:65bf1bc70f6b
tools, plugin XEP-0077: small fixes
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 25 Feb 2014 22:58:42 +0100 |
parents | 3ee2ec7ec010 |
children | cad8e52bb2e6 |
comparison
equal
deleted
inserted
replaced
875:19d7d077478a | 876:65bf1bc70f6b |
---|---|
329 | 329 |
330 class HeaderElement(Element): | 330 class HeaderElement(Element): |
331 """" Used by AdvancedListContainer """ | 331 """" Used by AdvancedListContainer """ |
332 type = 'header' | 332 type = 'header' |
333 | 333 |
334 def __init__(self, parent, name=None, Label=None, description=None): | 334 def __init__(self, parent, name=None, label=None, description=None): |
335 """ | 335 """ |
336 @param parent: AdvancedListContainer instance | 336 @param parent: AdvancedListContainer instance |
337 @param name: name of the container | 337 @param name: name of the container |
338 @param label: label to be displayed in columns | 338 @param label: label to be displayed in columns |
339 @param description: long descriptive text | 339 @param description: long descriptive text |
340 | 340 |
341 """ | 341 """ |
342 assert(isinstance(parent, AdvancedListContainer)) | 342 assert(isinstance(parent, AdvancedListContainer)) |
343 super(HeaderElement, self).__init__(parent.xmlui, parent) | 343 super(HeaderElement, self).__init__(parent.xmlui, parent) |
344 if name: | 344 if name: |
345 field_elt.setAttribute('name', name) | 345 self.elem.setAttribute('name', name) |
346 if label: | 346 if label: |
347 field_elt.setAttribute('label', label) | 347 self.elem.setAttribute('label', label) |
348 if description: | 348 if description: |
349 field_elt.setAttribute('description', description) | 349 self.elem.setAttribute('description', description) |
350 | 350 |
351 | 351 |
352 class Container(Element): | 352 class Container(Element): |
353 """ And Element which contains other ones and has a layout """ | 353 """ And Element which contains other ones and has a layout """ |
354 type = None | 354 type = None |
420 @param auto_index: if True, indexes will be generated by frontends, starting from 0 | 420 @param auto_index: if True, indexes will be generated by frontends, starting from 0 |
421 @return: created element | 421 @return: created element |
422 """ | 422 """ |
423 assert selectable in ('no', 'single') | 423 assert selectable in ('no', 'single') |
424 if not items and columns is None: | 424 if not items and columns is None: |
425 raise DataError(_("either items or columns need do be filled")) | 425 raise exceptions.DataError(_("either items or columns need do be filled")) |
426 if headers is None: | 426 if headers is None: |
427 headers = [] | 427 headers = [] |
428 if items is None: | 428 if items is None: |
429 items = [] | 429 items = [] |
430 super(AdvancedListContainer, self).__init__(xmlui, parent) | 430 super(AdvancedListContainer, self).__init__(xmlui, parent) |