tests/test_platypus_preformatted.py
branchpy33
changeset 3794 398ea04239b5
parent 3617 ae5744e97c42
child 3800 e8547b00eb59
--- a/tests/test_platypus_preformatted.py	Tue Nov 19 12:21:04 2013 +0000
+++ b/tests/test_platypus_preformatted.py	Tue Nov 19 13:50:34 2013 +0000
@@ -6,7 +6,6 @@
 from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
 setOutDir(__name__)
 import sys, os, random
-from string import split, strip, join, whitespace
 from operator import truth
 from types import StringType, ListType
 import unittest
@@ -101,7 +100,6 @@
 __version__=''' $Id: xpreformatted.py 3866 2011-06-27 13:08:20Z rgbecker $ '''
 __doc__='''A 'rich preformatted text' widget allowing internal markup'''
 
-import string
 from types import StringType, ListType
 from reportlab.lib import PyFontify
 from paragraph import Paragraph, cleanBlockQuotedText, _handleBulletWidth, ParaLines, _getFragWords, stringWidth, _sameFrag, getAscentDescent, imgVRange, imgNormV
@@ -110,7 +108,7 @@
 class XPreformatted(Paragraph):
     def __init__(self, text, style, bulletText = None, frags=None, caseSensitive=1, dedent=0):
         self.caseSensitive = caseSensitive
-        cleaner = lambda text, dedent=dedent: string.join(_dedenter(text or '',dedent),'\\n')
+        cleaner = lambda text, dedent=dedent: ,'\\n'.join(_dedenter(text or '',dedent))
         self._setup(text, style, bulletText, frags, cleaner)
 
     def breakLines(self, width):
@@ -138,12 +136,12 @@
                 fontName = f.fontName
                 ascent, descent = getAscentDescent(fontName,fontSize)
                 kind = 0
-                L=string.split(f.text, '\\n')
+                L=f.text.split('\\n')
                 for l in L:
                     currentWidth = stringWidth(l,fontName,fontSize)
                     requiredWidth = max(currentWidth,requiredWidth)
                     extraSpace = maxWidth-currentWidth
-                    lines.append((extraSpace,string.split(l,' '),currentWidth))
+                    lines.append((extraSpace,l.split(' '),currentWidth))
                     lineno = lineno+1
                     maxWidth = lineno<len(maxWidths) and maxWidths[lineno] or maxWidths[-1]
                 blPara = f.clone(kind=kind, lines=lines,ascent=ascent,descent=descent,fontSize=fontSize)