diff tools/xml_tools.py @ 95:be206a3d1a9b

Tarot game: score calculation - plugin tarot: score validity is now checked (some of attackers and defender must equal 91) - plugin tarot: new signal tarotGameScore to give the scores and winners/loosers - wix: score are now displayed at the end of the game - xml_tools: 'fixed' type is now managed in dataForm2xml
author Goffi <goffi@goffi.org>
date Wed, 02 Jun 2010 15:57:23 +0930
parents 39c672544593
children 94011f553cd0
line wrap: on
line diff
--- a/tools/xml_tools.py	Tue Jun 01 18:16:15 2010 +0930
+++ b/tools/xml_tools.py	Wed Jun 02 15:57:23 2010 +0930
@@ -46,7 +46,9 @@
             elem.appendChild(text)
             top_element.appendChild(elem)
         for field in form.fieldList:
-            if field.fieldType == 'text-single':
+            if field.fieldType == 'fixed':
+                __field_type = 'text'
+            elif field.fieldType == 'text-single':
                 __field_type = "string"
             elif field.fieldType == 'text-private':
                 __field_type = "password"
@@ -57,7 +59,8 @@
                 __field_type = "string"
             
             elem = doc.createElement('elem')
-            elem.setAttribute('name', field.var)
+            if field.var:
+                elem.setAttribute('name', field.var)
             elem.setAttribute('type', __field_type)
             elem.setAttribute('label', field.label or "")
             if field.value: