[PythonReports-checkins] PythonReports/PythonReports datatypes.py, 1.5, 1.6
Brought to you by:
a1s
From: alexander s. <a1...@us...> - 2007-06-23 16:16:53
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18472 Modified Files: datatypes.py Log Message: fix Validator.writexml: since we encode the attributes don't convert output data back to unicode (that would fail) and don't require unicode-aware writer Index: datatypes.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/datatypes.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** datatypes.py 8 Dec 2006 12:52:06 -0000 1.5 --- datatypes.py 23 Jun 2007 16:16:46 -0000 1.6 *************** *** 1,4 **** --- 1,7 ---- """Data types and element primitives, common for templates and printouts""" """History: + 23-jun-2007 [als] fix Validator.writexml: since we encode the attributes, + don't convert output data back to unicode (that would + fail) and don't require unicode-aware writer 07-dec-2006 [als] fix: qp-encoded data was accumulating spaces at the end 07-dec-2006 [als] fix decoding of qp-encoded data *************** *** 1007,1012 **** Parameters: ! writer: file-like object with "write" method ! able to accept unicode strings element: tree element of type handled by this validator encoding: character set name --- 1010,1014 ---- Parameters: ! writer: file-like output object element: tree element of type handled by this validator encoding: character set name *************** *** 1028,1038 **** _child_elements.append((_child, _validator)) if _child_elements: ! writer.write(u"%s<%s>%s" % (indent, _starttag, newl)) for (_child, _validator) in _child_elements: _validator.writexml(writer, _child, encoding, indent + addindent, addindent, newl) ! writer.write(u"%s</%s>%s" % (indent, self.tag, newl)) else: ! writer.write(u"%s<%s />%s" % (indent, _starttag, newl)) class _DataBlock(Validator): --- 1030,1040 ---- _child_elements.append((_child, _validator)) if _child_elements: ! writer.write("%s<%s>%s" % (indent, _starttag, newl)) for (_child, _validator) in _child_elements: _validator.writexml(writer, _child, encoding, indent + addindent, addindent, newl) ! writer.write("%s</%s>%s" % (indent, self.tag, newl)) else: ! writer.write("%s<%s />%s" % (indent, _starttag, newl)) class _DataBlock(Validator): |