report/render: fixes from xrg branch
This should log the rendering exceptions for reports. Also fix am error at custom fonts, suppress a message. Conflicts: bin/report/render/rml2pdf/utils.py bzr revid: p_christ@hol.gr-20101123151110-bckon1ji7hul20mp
This commit is contained in:
@@ -55,7 +55,7 @@ class rml2txt(render.render):
|
||||
def __init__(self, rml, localcontext= None, datas={}):
|
||||
super(rml2txt, self).__init__(datas)
|
||||
self.rml = rml
|
||||
self.localcontext = localcontext
|
||||
self.localcontext = localcontext
|
||||
self.output_type = 'txt'
|
||||
|
||||
def _render(self):
|
||||
|
||||
@@ -72,7 +72,7 @@ def FindCustomFonts():
|
||||
continue
|
||||
for d in dirpath:
|
||||
if os.path.exists(os.path.join(d, fname)):
|
||||
print "found font %s in %s" % (fname, d)
|
||||
# print "found font %s in %s" % (fname, d)
|
||||
__foundFonts.append(fname)
|
||||
break
|
||||
|
||||
@@ -87,9 +87,9 @@ def SetCustomFonts(rmldoc):
|
||||
This function is called once per report, so it should
|
||||
avoid system-wide processing (cache it, instead).
|
||||
"""
|
||||
global __foundFonts
|
||||
if not len(__foundFonts):
|
||||
FindCustomFonts()
|
||||
global __foundFonts
|
||||
for name, font, fname, mode in CustomTTFonts:
|
||||
if fname in __foundFonts:
|
||||
rmldoc.setTTFontMapping(name, font, fname, mode)
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
import copy
|
||||
import locale
|
||||
|
||||
import logging
|
||||
import re
|
||||
import reportlab
|
||||
|
||||
Reference in New Issue
Block a user