demos/rlzope/rlzope.py
branchpy33
changeset 3794 398ea04239b5
parent 3721 0c93dd8ff567
child 3848 86095f63b397
equal deleted inserted replaced
3793:cc3f9cc828f7 3794:398ea04239b5
    10 #
    10 #
    11 # Author : Jerome Alet - alet@librelogiciel.com
    11 # Author : Jerome Alet - alet@librelogiciel.com
    12 #
    12 #
    13 #
    13 #
    14 
    14 
    15 import string, io
    15 import io
    16 try :
    16 try :
    17     from Shared.reportlab.platypus.paragraph import Paragraph
    17     from Shared.reportlab.platypus.paragraph import Paragraph
    18     from Shared.reportlab.platypus.doctemplate import *
    18     from Shared.reportlab.platypus.doctemplate import *
    19     from Shared.reportlab.lib.units import inch
    19     from Shared.reportlab.lib.units import inch
    20     from Shared.reportlab.lib import styles
    20     from Shared.reportlab.lib import styles
   121         """Appends an object to our platypus "story" (using ReportLab's terminology)."""
   121         """Appends an object to our platypus "story" (using ReportLab's terminology)."""
   122         self.objects.append(object)
   122         self.objects.append(object)
   123 
   123 
   124     def escapexml(self, s) :
   124     def escapexml(self, s) :
   125         """Escape some xml entities."""
   125         """Escape some xml entities."""
   126         s = string.strip(s)
   126         s = s.strip()
   127         s = string.replace(s, "&", "&")
   127         s = s.replace("&", "&")
   128         s = string.replace(s, "<", "&lt;")
   128         s = s.replace("<", "&lt;")
   129         return string.replace(s, ">", "&gt;")
   129         return s.replace(">", "&gt;")
   130 
   130 
   131 def rlzope(self) :
   131 def rlzope(self) :
   132     """A sample external method to show people how to use ReportLab from within Zope."""
   132     """A sample external method to show people how to use ReportLab from within Zope."""
   133     try:
   133     try:
   134         #
   134         #