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:
P. Christeas
2010-11-23 17:11:10 +02:00
parent d1347d0b0d
commit 27ae6f3522
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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):
+2 -2
View File
@@ -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)
+1
View File
@@ -38,6 +38,7 @@
import copy
import locale
import logging
import re
import reportlab