diff --git a/bin/report/render/rml.py b/bin/report/render/rml.py index c30549b4bb0..0bc78f95555 100644 --- a/bin/report/render/rml.py +++ b/bin/report/render/rml.py @@ -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): diff --git a/bin/report/render/rml2pdf/customfonts.py b/bin/report/render/rml2pdf/customfonts.py index 96ccc759ce1..11c35749d4c 100644 --- a/bin/report/render/rml2pdf/customfonts.py +++ b/bin/report/render/rml2pdf/customfonts.py @@ -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) diff --git a/bin/report/render/rml2pdf/utils.py b/bin/report/render/rml2pdf/utils.py index 076c8405118..e607aabeb20 100644 --- a/bin/report/render/rml2pdf/utils.py +++ b/bin/report/render/rml2pdf/utils.py @@ -38,6 +38,7 @@ import copy import locale + import logging import re import reportlab