Mercurial > libervia-backend
comparison tools/xml_tools.py @ 39:2e3411a6baad
Wix: external server management in gateways manager, SàT: bug fixes in gateway management
- SàT: from twisted.words.protocols.jabber.error module imported as jab_error to avoir name colision with error log method
- XEP_0100 plugin: added errback for disco info
- XEP_0077 plugin: registration callback now look for "x" element (data form: see XEP-0004), and send an error message if it can't find it.
- Wix: added fields for browsing external server gateways
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 17 Dec 2009 17:29:02 +1100 |
parents | a61beb21d16d |
children | a5b5fb5fc9fd |
comparison
equal
deleted
inserted
replaced
38:3e24753b9e0b | 39:2e3411a6baad |
---|---|
50 __field_type = "string" | 50 __field_type = "string" |
51 elif field.fieldType == 'text-private': | 51 elif field.fieldType == 'text-private': |
52 __field_type = "password" | 52 __field_type = "password" |
53 else: | 53 else: |
54 error (u"FIXME FIXME FIXME: Type [%s] is not managed yet by SàT" % field.fieldType) | 54 error (u"FIXME FIXME FIXME: Type [%s] is not managed yet by SàT" % field.fieldType) |
55 __field_type = "string_field" | 55 __field_type = "string" |
56 | 56 |
57 elem = doc.createElement('elem') | 57 elem = doc.createElement('elem') |
58 elem.setAttribute('name', field.var) | 58 elem.setAttribute('name', field.var) |
59 elem.setAttribute('type', __field_type) | 59 elem.setAttribute('type', __field_type) |
60 elem.setAttribute('label', field.label) | 60 elem.setAttribute('label', field.label or "") |
61 if field.value: | 61 if field.value: |
62 text = doc.createTextNode(field.value) | 62 text = doc.createTextNode(field.value) |
63 elem.appendChild(text) | 63 elem.appendChild(text) |
64 top_element.appendChild(elem) | 64 top_element.appendChild(elem) |
65 | |
66 result = doc.toxml() | 65 result = doc.toxml() |
67 doc.unlink() | 66 doc.unlink() |
68 return result | 67 return result |
69 | 68 |
70 @staticmethod | 69 @staticmethod |