dabo Commit
Revision 6077
Date: 2010-10-06 11:09:32 -0700 (Wed, 06 Oct 2010)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6077

Changed:
U   trunk/dabo/lib/reportWriter.py

Log:
Removed duplicate code from r6076.


Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py      2010-10-05 23:56:06 UTC (rev 6076)
+++ trunk/dabo/lib/reportWriter.py      2010-10-06 18:09:32 UTC (rev 6077)
@@ -56,9 +56,8 @@
 from dabo.lib.caselessDict import CaselessDict
 from reportlab.lib.utils import ImageReader
 from dabo.lib.utils import ustr, resolvePathAndUpdate
-from reportlab.pdfbase.pdfmetrics import registerFont
+from reportlab.pdfbase.pdfmetrics import registerFont, getRegisteredFontNames
 from reportlab.pdfbase.ttfonts import TTFont, TTFError
-from reportlab.pdfbase.pdfmetrics import getRegisteredFontNames
 from reportlab.rl_config import TTFSearchPath
 import Image as PILImage
 import reportUtils
@@ -88,17 +87,6 @@
        addReportTTFontFilePath(dabo.reportTTFontFilePath)
 
 
-def addReportTTFontFilePath(paths):
-       if isinstance(paths, basestring):
-               paths = (paths,)
-       for path in paths:
-               TTFSearchPath.append(path)
-
-
-if dabo.reportTTFontFilePath:
-       addReportTTFontFilePath(dabo.reportTTFontFilePath)
-
-
 ## Can't use None for uninitialized group values, because None
 ## could be a meaningful value in the dataset.
 UNINITIALIZED_VALUE = 'UNINITIALIZED_f49dc68b-1e4c-43ad-81c1-227c1e4f59e6'
@@ -119,10 +107,12 @@
                self.__rw = rw
                self.__saved_page_states = []
 
+
        def showPage(self):
                self.__saved_page_states.append(dict(self.__dict__))
                self._startPage()
 
+
        def showPages(self):
                for idx, state in enumerate(self.__saved_page_states):
                        self.__dict__.update(state)
@@ -130,21 +120,11 @@
                        canvas.Canvas.showPage(self)
                self.__saved_page_states = []
 
+
        def drawPageCounts(self, page):
                # callback to the rw to draw the cached pagecount strings
                self.__rw.drawPageCounts(page, len(self.__saved_page_states))
 
-       def setFont(self, psfontname, size, leading=None):
-               if psfontname not in getRegisteredFontNames():
-                       if psfontname in dabo.reportTTFontFileMap:
-                               psfontfile = 
dabo.reportTTFontFileMap[psfontname]
-                       else:
-                               psfontfile = "%s.ttf" % psfontname
-                       try:
-                               registerFont(TTFont(psfontname, psfontfile))
-                       except TTFError:
-                               dabo.log.info(_("Font file can not be found: 
%s") % psfontfile)
-               canvas.Canvas.setFont(self, psfontname, size, leading)
 
        def setFont(self, psfontname, size, leading=None):
                if psfontname not in getRegisteredFontNames():
@@ -158,6 +138,8 @@
                                dabo.log.info(_("Font file can not be found: 
%s") % psfontfile)
                canvas.Canvas.setFont(self, psfontname, size, leading)
 
+
+
 class ReportObjectCollection(list):
        """Abstract ordered list of things like variables, groups, and band 
objects."""
 



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to