demos/rlzope/rlzope.py
branchpy33
changeset 3721 0c93dd8ff567
parent 3256 f31a47336a0f
child 3794 398ea04239b5
--- a/demos/rlzope/rlzope.py	Fri Feb 15 15:54:16 2013 +0000
+++ b/demos/rlzope/rlzope.py	Tue Apr 30 14:20:22 2013 +0100
@@ -12,7 +12,7 @@
 #
 #
 
-import string, cStringIO
+import string, io
 try :
     from Shared.reportlab.platypus.paragraph import Paragraph
     from Shared.reportlab.platypus.doctemplate import *
@@ -55,7 +55,7 @@
                 return None
 
             # Convert it to PIL
-            image = ImageReader(cStringIO.StringIO(str(logo.data)))
+            image = ImageReader(io.StringIO(str(logo.data)))
             (width, height) = image.getSize()
 
             # scale it to be 0.75 inch high
@@ -84,7 +84,7 @@
 
         # we will build an in-memory document
         # instead of creating an on-disk file.
-        self.report = cStringIO.StringIO()
+        self.report = io.StringIO()
 
         # initialise a PDF document using ReportLab's platypus
         self.document = BaseDocTemplate(self.report)
@@ -158,7 +158,7 @@
         self.REQUEST.RESPONSE.setHeader('Content-Disposition', 'attachment; filename=%s' % filename)
     except:
         import traceback, sys, cgi
-        content = sys.stdout = sys.stderr = cStringIO.StringIO()
+        content = sys.stdout = sys.stderr = io.StringIO()
         self.REQUEST.RESPONSE.setHeader('Content-Type', 'text/html')
         traceback.print_exc()
         sys.stdout = sys.__stdout__