Update of /cvsroot/pythonreports/PythonReports/PythonReports
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24088
Modified Files:
datatypes.py
Log Message:
fix: qp-encoded data was accumulating spaces at the end
Index: datatypes.py
===================================================================
RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/datatypes.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** datatypes.py 7 Dec 2006 19:29:26 -0000 1.4
--- datatypes.py 8 Dec 2006 12:52:06 -0000 1.5
***************
*** 1,4 ****
--- 1,5 ----
"""Data types and element primitives, common for templates and printouts"""
"""History:
+ 07-dec-2006 [als] fix: qp-encoded data was accumulating spaces at the end
07-dec-2006 [als] fix decoding of qp-encoded data
05-dec-2006 [als] sweep pylint warnings
***************
*** 1182,1187 ****
--- 1183,1193 ----
# W0613: Unused argument 'addindent' - API comes from Validator,
# but there are no child elements in the data element
+ _text = element.text or ""
if element.get("encoding"):
_indent2 = indent
+ # we will be adding certain amount of space before the closing tag
+ # to make it certain amount indeed, make sure there aren't any
+ # spaces yet.
+ _text = _text.rstrip(" ")
else:
# must not add blank spaces to non-encoded values
***************
*** 1190,1194 ****
# (the text, if any, must be already encoded by .make_element)
_text = u"%s<%s>%s%s</%s>%s" % (indent, self.starttag(element),
! element.text or "", _indent2, self.tag, newl)
writer.write(_text.encode(encoding, "xmlcharrefreplace"))
--- 1196,1200 ----
# (the text, if any, must be already encoded by .make_element)
_text = u"%s<%s>%s%s</%s>%s" % (indent, self.starttag(element),
! _text, _indent2, self.tag, newl)
writer.write(_text.encode(encoding, "xmlcharrefreplace"))
|