Commit 2afc4dcc authored by Vincent Pelletier's avatar Vincent Pelletier

renderPDF must not be bound to a class, because it's only used as a "regular"...

renderPDF must not be bound to a class, because it's only used as a "regular" monkey patch for CMFReport's version. This change fixes PDFTemplate under Zope 2.8.
Updated some logs (even if they are commented out) to follow the naming change.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13751 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a9de0b52
......@@ -279,9 +279,7 @@ else:
class ERP5ReportTool(ReportTool):
def renderPDF(self, templatename, document_xml, *args, **kwargs):
def ReportTool_renderPDF(self, templatename, document_xml, *args, **kwargs):
"""
Render document using template
"""
......@@ -291,7 +289,7 @@ class ERP5ReportTool(ReportTool):
context = self
encoding = kwargs.get('encoding') or 'UTF-8'
#LOG('ERP5ReportTool', 0, 'encoding = %r' % encoding)
#LOG('ReportTool_renderPDF', 0, 'encoding = %r' % encoding)
rhandler = ERP5ResourceHandler(context, getattr(self, 'resourcePath', None))
# if zope gives us the xml in unicode
......@@ -301,7 +299,7 @@ class ERP5ReportTool(ReportTool):
template_xml = self._encode(template_xml, encoding)
if type(document_xml) is type(u''):
document_xml = self._encode(document_xml, encoding)
#LOG('ERP5ReportTool', 0, 'template_xml = %r, document_xml = %r' % (template_xml, document_xml))
#LOG('ReportTool_renderPDF', 0, 'template_xml = %r, document_xml = %r' % (template_xml, document_xml))
# XXXXX Because reportlab does not support UTF-8, use Latin-1. What a mess.
template_xml = unicode(template_xml,encoding).encode('iso-8859-1')
......@@ -325,4 +323,4 @@ class ERP5ReportTool(ReportTool):
return buf.read()
ReportTool.renderPDF = ERP5ReportTool.renderPDF
ReportTool.renderPDF = ReportTool_renderPDF
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment