xmlclass/xsdschema.py
changeset 1374 1eefc427419f
parent 1373 4278d5c1e414
child 1375 dc94c71a2f25
equal deleted inserted replaced
1373:4278d5c1e414 1374:1eefc427419f
    43             text += "</%s>\n" % name
    43             text += "</%s>\n" % name
    44         return text
    44         return text
    45     return generateXMLTextMethod
    45     return generateXMLTextMethod
    46 
    46 
    47 def GenerateFloatXMLText(extra_values=[], decimal=None):
    47 def GenerateFloatXMLText(extra_values=[], decimal=None):
    48     float_format = ("{:.%dg}" % decimal).format if decimal is not None else str
    48     float_format = (lambda x: "{:.{width}f}".format(x, width=decimal).rstrip('0')
       
    49                     if decimal is not None else str)
    49     def generateXMLTextMethod(value, name=None, indent=0):
    50     def generateXMLTextMethod(value, name=None, indent=0):
    50         text = ""
    51         text = ""
    51         if name is not None:
    52         if name is not None:
    52             ind1, ind2 = getIndent(indent, name)
    53             ind1, ind2 = getIndent(indent, name)
    53             text += ind1 + "<%s>" % name
    54             text += ind1 + "<%s>" % name