Mercurial > libervia-backend
comparison src/tools/xml_tools.py @ 1142:2f9f735334da
core (XMLUI): sugar method "note" allow to easily create a XMLUI note dialog (more methods for other dialogs should follow)
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 27 Aug 2014 01:24:26 +0200 |
parents | 7fcafc3206b1 |
children | 96fb74a4714d |
comparison
equal
deleted
inserted
replaced
1141:7fcafc3206b1 | 1142:2f9f735334da |
---|---|
1024 def toXml(self): | 1024 def toXml(self): |
1025 """return the XML representation of the panel""" | 1025 """return the XML representation of the panel""" |
1026 return self.doc.toxml() | 1026 return self.doc.toxml() |
1027 | 1027 |
1028 | 1028 |
1029 # Some sugar for XMLUI dialogs | |
1030 | |
1031 def note(message, title='', level=C.XMLUI_DATA_LVL_INFO): | |
1032 """Sugar to easily create a Note Dialog | |
1033 | |
1034 @param message: body of the note | |
1035 @param title: title of the note | |
1036 @param level: one of C.XMLUI_DATA_LVL_* | |
1037 """ | |
1038 note_xmlui = XMLUI(C.XMLUI_DIALOG, dialog_opt = { | |
1039 C.XMLUI_DATA_TYPE: C.XMLUI_DIALOG_NOTE, | |
1040 C.XMLUI_DATA_MESS: message, | |
1041 C.XMLUI_DATA_LVL: level}, | |
1042 title=title | |
1043 ) | |
1044 return note_xmlui | |
1045 | |
1029 # Misc other funtions | 1046 # Misc other funtions |
1030 | 1047 |
1031 | 1048 |
1032 class ElementParser(object): | 1049 class ElementParser(object): |
1033 """callable class to parse XML string into Element | 1050 """callable class to parse XML string into Element |