Whitespace and tab character cleanup
authorandy_robinson
Mon, 04 Nov 2002 00:11:49 +0000
changeset 1771 105572a4222f
parent 1770 1c91caccd7e3
child 1772 ba6ba46e2370
Whitespace and tab character cleanup
reportlab/docs/userguide/ch1_intro.py
reportlab/graphics/charts/dotbox.py
reportlab/graphics/charts/slidebox.py
reportlab/lib/rparsexml.py
reportlab/pdfbase/pdfdoc.py
reportlab/pdfgen/canvas.py
reportlab/pdfgen/pycanvas.py
reportlab/platypus/para.py
reportlab/setup.py
reportlab/setup_reportlab.py
reportlab/test/test_platypus_paragraphs.py
reportlab/test/test_renderSVG.py
reportlab/test/test_source_chars.py
reportlab/tools/pythonpoint/pythonpoint.py
reportlab/tools/pythonpoint/stdparser.py
--- a/reportlab/docs/userguide/ch1_intro.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/docs/userguide/ch1_intro.py	Mon Nov 04 00:11:49 2002 +0000
@@ -1,7 +1,7 @@
 #copyright ReportLab Inc. 2000-2001
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/docs/userguide/ch1_intro.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/docs/userguide/ch1_intro.py,v 1.12 2002/09/07 08:54:21 dragan1 Exp $
+#$Header: /tmp/reportlab/reportlab/docs/userguide/ch1_intro.py,v 1.13 2002/11/04 00:11:48 andy_robinson Exp $
 from reportlab.tools.docco.rl_doc_utils import *
 import reportlab
 
@@ -442,7 +442,7 @@
 
 list("""
 Before installing Jython, make sure you have a supported version of
-Java Virtual Machine installed. For the list of supported JVM's see 
+Java Virtual Machine installed. For the list of supported JVM's see
 $http://www.jython.org/platform.html$
 """)
 
--- a/reportlab/graphics/charts/dotbox.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/graphics/charts/dotbox.py	Mon Nov 04 00:11:49 2002 +0000
@@ -1,6 +1,6 @@
 from reportlab.lib.colors import blue, _PCMYK_black
 from reportlab.graphics.charts.textlabels import Label
-from reportlab.graphics.shapes import Circle, Drawing, Group, Line, Rect, String 
+from reportlab.graphics.shapes import Circle, Drawing, Group, Line, Rect, String
 from reportlab.graphics.widgetbase import Widget
 from reportlab.lib.attrmap import *
 from reportlab.lib.validators import *
@@ -42,7 +42,7 @@
         y = AttrMapValue(isNumber,
             desc='Y Position of dotbox'),
         )
-    
+
     def __init__(self):
         self.xlabels=["Value", "Blend", "Growth"]
         self.ylabels=["Small", "Medium", "Large"]
@@ -80,7 +80,7 @@
     def demo(self,drawing=None):
         if not drawing:
             tx,ty=self._getDrawingDimensions()
-            drawing = Drawing(tx,ty)        
+            drawing = Drawing(tx,ty)
         drawing.add(self.draw())
         return drawing
 
@@ -92,7 +92,7 @@
                    strokeColor=self.gridColor,
                    strokeWidth=self.strokeWidth,
                    fillColor=None))
-        
+
         #internal gridding
         for f in range (1,len(self.ylabels)):
             #horizontal
@@ -124,7 +124,7 @@
         if ascent==0:
             ascent=0.718 # default (from helvetica)
         ascent=ascent*self.labelFontSize # normalize
-        
+
         #do y-labels
         if self.ylabels != None:
             for f in range (len(self.ylabels)-1,-1,-1):
@@ -155,7 +155,7 @@
                     l.draw()
                     g.add(l)
 
-        return g        
+        return g
 
 
 
--- a/reportlab/graphics/charts/slidebox.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/graphics/charts/slidebox.py	Mon Nov 04 00:11:49 2002 +0000
@@ -40,7 +40,7 @@
         sourceLabelFontSize = AttrMapValue(isNumber, desc="Font size for the 'source' label"),
         sourceLabelFillColor = AttrMapValue(isColorOrNone, desc="Colour ink for the 'source' label (bottom right)"),
         )
-    
+
     def __init__(self):
         self.labelFontName = "Helvetica-Bold"
         self.labelFontSize = 10
@@ -70,7 +70,7 @@
         self.sourceLabelFontName = "Helvetica-Oblique"
         self.sourceLabelFontSize = 6
         self.sourceLabelFillColor = black
-        
+
     def _getDrawingDimensions(self):
         tx=(self.numberOfBoxes*self.boxWidth)
         if self.numberOfBoxes>1: tx=tx+((self.numberOfBoxes-1)*self.boxSpacing)
@@ -94,10 +94,10 @@
         from reportlab.lib import colors
         if not drawing:
             tx,ty=self._getDrawingDimensions()
-            drawing = Drawing(tx,ty)        
+            drawing = Drawing(tx,ty)
         drawing.add(self.draw())
         return drawing
-    
+
     def draw(self):
         g = Group()
         ys = self.bottomPadding+(self.triangleHeight/2)+self.sourceLabelOffset+self.sourceLabelFontSize
@@ -128,7 +128,7 @@
             sr.fillColorEnd = colorsList[f+1]
             sr.strokeColor = None
             sr.strokeWidth = 0
-            
+
             g.add(sr)
 
             g.add(Rect(x,0,self.boxWidth,self.boxHeight,
--- a/reportlab/lib/rparsexml.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/lib/rparsexml.py	Mon Nov 04 00:11:49 2002 +0000
@@ -24,18 +24,18 @@
 
 where miscellaneousinfo can be anything, (but defaults to None)
 (with the intention of adding, eg, line number information)
-    
+
 special cases: name of "" means "top level, no containing tag".
 Top level parse always looks like this
 
    ("", list, None, None)
 
  contained text of None means <simple_tag\>
-    
+
 In order to support stuff like
 
    <this></this><one></one>
-   
+
 AT THE MOMENT &amp; ETCETERA ARE IGNORED. THEY MUST BE PROCESSED
 IN A POST-PROCESSING STEP.
 
@@ -75,7 +75,7 @@
             return oneOutermostTag and p or ('',None,[p],None)
 except ImportError:
     simpleparse = 1
-    
+
 NONAME = ""
 NAMEKEY = 0
 CONTENTSKEY = 1
@@ -111,7 +111,7 @@
     raw = open(filename, 'r').read()
     return parsexml(raw)
 
-    
+
 verbose = 0
 
 def skip_prologue(text, cursor):
@@ -138,8 +138,8 @@
             done=1
     #print "done skipping"
     return cursor
-    
-def parsexml0(xmltext, startingat=0, toplevel=1, 
+
+def parsexml0(xmltext, startingat=0, toplevel=1,
         # snarf in some globals
         strip=string.strip, split=string.split, find=string.find,
         #len=len, None=None
@@ -343,7 +343,7 @@
                     raise ValueError, \
                        "at lines %s...%s close tag name doesn't match %s...%s %s" %(
                        linenum, endlinenum, `name`, `closename`, repr(xmltext[cursor: cursor+100]))
-                remainder = xmltext[cursor:nextopenbracket]   
+                remainder = xmltext[cursor:nextopenbracket]
                 if remainder:
                     #if verbose: print "remainder", repr(remainder)
                     L.append(remainder)
@@ -356,7 +356,7 @@
                 remainder = xmltext[cursor:nextopenbracket]
                 if remainder:
                     L.append(remainder)
-                #if verbose: 
+                #if verbose:
                 #    #print "skipping", repr(remainder)
                 #    #print "--- recursively parsing starting at", xmltext[nextopenbracket:nextopenbracket+20]
                 (parsetree, cursor) = parsexml0(xmltext, startingat=nextopenbracket, toplevel=None)
@@ -371,7 +371,7 @@
         ContentList = unEscapeContentList(ContentList)
     t = (NameString, AttDict, ContentList, ExtraStuff)
     return (t, cursor)
-    
+
 import types
 def pprettyprint(parsedxml):
     """pretty printer mainly for testing"""
@@ -415,7 +415,7 @@
         print "============== reformatting"
         p = pprettyprint(D)
         print p
-    
+
 def test():
     testparse("""<this type="xml">text &lt;&gt;<b>in</b> <funnytag foo="bar"/> xml</this>
                  <!-- comment -->
@@ -423,14 +423,14 @@
                  <this type="xml">text <b>in</b> xml</this> ]]>
                  <tag with="<brackets in values>">just testing brackets feature</tag>
                  """)
-                 
+
 filenames = [ #"../../reportlab/demos/pythonpoint/pythonpoint.xml",
               "samples/hamlet.xml"]
 
 #filenames = ["moa.xml"]
 
 dump=1
-                 
+
 if __name__=="__main__":
     test()
     from time import time
@@ -440,7 +440,7 @@
         print "parsing", f
         testparse(t)
     print "elapsed", time()-now
-    
+
 
-        
-    
+
+
--- a/reportlab/pdfbase/pdfdoc.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/pdfbase/pdfdoc.py	Mon Nov 04 00:11:49 2002 +0000
@@ -1,8 +1,8 @@
 #copyright ReportLab Inc. 2000
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/pdfbase/pdfdoc.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/pdfbase/pdfdoc.py,v 1.70 2002/10/22 17:55:37 rgbecker Exp $
-__version__=''' $Id: pdfdoc.py,v 1.70 2002/10/22 17:55:37 rgbecker Exp $ '''
+#$Header: /tmp/reportlab/reportlab/pdfbase/pdfdoc.py,v 1.71 2002/11/04 00:11:48 andy_robinson Exp $
+__version__=''' $Id: pdfdoc.py,v 1.71 2002/11/04 00:11:48 andy_robinson Exp $ '''
 __doc__="""
 The module pdfdoc.py handles the 'outer structure' of PDF documents, ensuring that
 all objects are properly cross-referenced and indexed to the nearest byte.  The
@@ -1755,7 +1755,7 @@
         #standardize it to RGB.  We could be more optimal later.
         if PILImage.mode <> 'RGB':
             PILImage = PILImage.convert('RGB')
-        
+
         self.width, self.height = PILImage.size
         raw = PILImage.tostring()
         assert(len(raw) == self.width*self.height, "Wrong amount of data for image")
--- a/reportlab/pdfgen/canvas.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/pdfgen/canvas.py	Mon Nov 04 00:11:49 2002 +0000
@@ -1,8 +1,8 @@
 #copyright ReportLab Inc. 2000
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/pdfgen/canvas.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/pdfgen/canvas.py,v 1.106 2002/11/03 23:47:05 andy_robinson Exp $
-__version__=''' $Id: canvas.py,v 1.106 2002/11/03 23:47:05 andy_robinson Exp $ '''
+#$Header: /tmp/reportlab/reportlab/pdfgen/canvas.py,v 1.107 2002/11/04 00:11:48 andy_robinson Exp $
+__version__=''' $Id: canvas.py,v 1.107 2002/11/04 00:11:48 andy_robinson Exp $ '''
 __doc__="""
 The Canvas object is the primary interface for creating PDF files. See
 doc/userguide.pdf for copious examples.
@@ -1316,7 +1316,7 @@
         by the 'duration' argument to setPageTransition; this controls
         the time spent looking at the page.  This is effective for all
         subsequent pages."""
-        
+
         self._pageDuration = duration
 
     def setPageTransition(self, effectname=None, duration=1,
--- a/reportlab/pdfgen/pycanvas.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/pdfgen/pycanvas.py	Mon Nov 04 00:11:49 2002 +0000
@@ -5,94 +5,94 @@
 
 __doc__ = """pycanvas.Canvas : a Canvas class which can also output Python source code.
 
-pycanvas.Canvas class works exactly like canvas.Canvas, but you can 
-call str() on pycanvas.Canvas instances. Doing so will return the 
-Python source code equivalent to your own program, which would, when 
-run, produce the same PDF document as your original program. 
+pycanvas.Canvas class works exactly like canvas.Canvas, but you can
+call str() on pycanvas.Canvas instances. Doing so will return the
+Python source code equivalent to your own program, which would, when
+run, produce the same PDF document as your original program.
 
-Generated Python source code defines a doIt() function which accepts 
-a filename or file-like object as its first parameter, and an 
-optional boolean parameter named "regenerate". 
+Generated Python source code defines a doIt() function which accepts
+a filename or file-like object as its first parameter, and an
+optional boolean parameter named "regenerate".
 
-The doIt() function will generate a PDF document and save it in the 
-file you specified in this argument. If the regenerate parameter is 
-set then it will also return an automatically generated equivalent 
-Python source code as a string of text, which you can run again to 
-produce the very same PDF document and the Python source code, which 
-you can run again... ad nauseam ! If the regenerate parameter is 
-unset or not used at all (it then defaults to being unset) then None 
-is returned and the doIt() function is much much faster, it is also 
-much faster than the original non-serialized program. 
+The doIt() function will generate a PDF document and save it in the
+file you specified in this argument. If the regenerate parameter is
+set then it will also return an automatically generated equivalent
+Python source code as a string of text, which you can run again to
+produce the very same PDF document and the Python source code, which
+you can run again... ad nauseam ! If the regenerate parameter is
+unset or not used at all (it then defaults to being unset) then None
+is returned and the doIt() function is much much faster, it is also
+much faster than the original non-serialized program.
 
-the reportlab/test/test_pdfgen_pycanvas.py program is the test suite 
-for pycanvas, you can do the following to run it : 
+the reportlab/test/test_pdfgen_pycanvas.py program is the test suite
+for pycanvas, you can do the following to run it :
 
     First set verbose=1 in reportlab/rl_config.py
-    
+
     then from the command interpreter :
-    
+
     $ cd reportlab/test
     $ python test_pdfgen_pycanvas.py >n1.py
-    
+
     this will produce both n1.py and test_pdfgen_pycanvas.pdf
-    
+
     then :
-    
+
     $ python n1.py n1.pdf >n2.py
     $ python n2.py n2.pdf >n3.py
     $ ...
-    
+
     n1.py, n2.py, n3.py and so on will be identical files.
-    they eventually may end being a bit different because of 
-    rounding problems, mostly in the comments, but this 
+    they eventually may end being a bit different because of
+    rounding problems, mostly in the comments, but this
     doesn't matter since the values really are the same
     (e.g. 0 instead of 0.0, or .53 instead of 0.53)
-    
+
     n1.pdf, n2.pdf, n3.pdf and so on will be PDF files
     similar to test_pdfgen_pycanvas.pdf.
-    
+
 Alternatively you can import n1.py (or n3.py, or n16384.py if you prefer)
 in your own program, and then call its doIt function :
 
     import n1
     pythonsource = n1.doIt("myfile.pdf", regenerate=1)
-    
+
 Or if you don't need the python source code and want a faster result :
 
     import n1
     n1.doIt("myfile.pdf")
-    
+
 When the generated source code is run directly as an independant program,
 then the equivalent python source code is printed to stdout, e.g. :
 
-    python n1.py 
-    
+    python n1.py
+
     will print the python source code equivalent to n1.py
 
 Why would you want to use such a beast ?
-    
-    - To linearize (serialize?) a program : optimizing some complex 
-      parts for example. 
-    
+
+    - To linearize (serialize?) a program : optimizing some complex
+      parts for example.
+
     - To debug : reading the generated Python source code may help you or
       the ReportLab team to diagnose problems. The generated code is now
       clearly commented and shows nesting levels, page numbers, and so
       on. You can use the generated script when asking for support : we
       can see the results you obtain without needing your datas or complete
       application.
-    
+
     - To create standalone scripts : say your program uses a high level
-      environment to generate its output (databases, RML, etc...), using 
-      this class would give you an equivalent program but with complete 
-      independance from the high level environment (e.g. if you don't 
+      environment to generate its output (databases, RML, etc...), using
+      this class would give you an equivalent program but with complete
+      independance from the high level environment (e.g. if you don't
       have Oracle).
-    
+
     - To contribute some nice looking PDF documents to the ReportLab website
       without having to send a complete application you don't want to
       distribute.
-      
+
     - ... Insert your own ideas here ...
-    
+
     - For fun because you can do it !
 """
 
@@ -114,9 +114,9 @@
 
 def doIt(file, regenerate=0) :
     """Generates a PDF document, save it into file.
-    
+
        file : either a filename or a file-like object.
-       
+
        regenerate : if set then this function returns the Python source
                     code which when run will produce the same result.
                     if unset then this function returns None, and is
@@ -140,9 +140,9 @@
         sys.exit(-1)
     else :
         # we've got a filename, we can proceed.
-        print doIt(sys.argv[1], regenerate=1)    
+        print doIt(sys.argv[1], regenerate=1)
         sys.exit(0)'''
-    
+
 def buildargs(*args, **kwargs) :
     """Constructs a printable list of arguments suitable for use in source function calls."""
     arguments = ""
@@ -152,7 +152,7 @@
         arguments = arguments+ ("%s=%s, " % (kw, repr(val)))
     if arguments[-2:] == ", " :
         arguments = arguments[:-2]
-    return arguments    
+    return arguments
 
 class PDFAction :
     """Base class to fake method calls or attributes on PDF objects (Canvas, PDFPathObject, PDFTextObject)."""
@@ -160,38 +160,38 @@
         """Saves a pointer to the parent object, and the method name."""
         self._parent = parent
         self._action = action
-    
+
     def __getattr__(self, name) :
         """Probably a method call on an attribute, returns the real one."""
         return getattr(getattr(self._parent._object, self._action), name)
-        
+
     def __call__(self, *args, **kwargs) :
         """The fake method is called, print it then call the real one."""
         if not self._parent._parent._in :
             self._precomment()
             self._parent._parent._PyWrite("    %s.%s(%s)" % (self._parent._name, self._action, apply(buildargs, args, kwargs)))
-            self._postcomment() 
-        self._parent._parent._in = self._parent._parent._in + 1 
+            self._postcomment()
+        self._parent._parent._in = self._parent._parent._in + 1
         retcode = apply(getattr(self._parent._object, self._action), args, kwargs)
         self._parent._parent._in = self._parent._parent._in - 1
         return retcode
-        
+
     def __str__(self) :
         """Needed for Python 2.1"""
         return str(getattr(self._parent._object, self._action))
-    
+
     def __coerce__(self, other) :
         """Needed for Python 2.1"""
         return coerce(getattr(self._parent._object, self._action), other)
-        
-    def _precomment(self) : 
+
+    def _precomment(self) :
         """To be overriden."""
         pass
-        
+
     def _postcomment(self) :
         """To be overriden."""
         pass
-        
+
 class PDFObject :
     """Base class for PDF objects like PDFPathObject and PDFTextObject."""
     _number = 0
@@ -199,15 +199,15 @@
         """Saves a pointer to the parent Canvas."""
         self._parent = parent
         self._initdone = 0
-    
+
     def __getattr__(self, name) :
         """The user's programs wants to call one of our methods or get an attribute, fake it."""
         return PDFAction(self, name)
-        
+
     def __repr__(self) :
         """Returns the name used in the generated source code (e.g. 'p' or 't')."""
         return self._name
-        
+
     def __call__(self, *args, **kwargs) :
         """Real object initialisation is made here, because now we've got the arguments."""
         if not self._initdone :
@@ -216,51 +216,51 @@
             self._parent._PyWrite("\n    # create PDF%sObject number %i\n    %s = %s.%s(%s)" % (methodname[5:], self.__class__._number, self._name, self._parent._name, methodname, apply(buildargs, args, kwargs)))
             self._initdone = 1
         return self
-    
+
 class Canvas :
-    """Our fake Canvas class, which will intercept each and every method or attribute access.""" 
+    """Our fake Canvas class, which will intercept each and every method or attribute access."""
     class TextObject(PDFObject) :
         _name = "t"
         def _postinit(self, *args, **kwargs) :
             self._object = apply(textobject.PDFTextObject, (self._parent, ) + args, kwargs)
             return "beginText"
-        
+
     class PathObject(PDFObject) :
         _name = "p"
         def _postinit(self, *args, **kwargs) :
             self._object = apply(pathobject.PDFPathObject, args, kwargs)
             return "beginPath"
-        
+
     class Action(PDFAction) :
         """Class called for every Canvas method call."""
         def _precomment(self) :
             """Outputs comments before the method call."""
             if self._action == "showPage" :
                 self._parent._PyWrite("\n    # Ends page %i" % self._parent._pagenumber)
-            elif self._action == "saveState" :    
+            elif self._action == "saveState" :
                 state = {}
                 d = self._parent._object.__dict__
                 for name in self._parent._object.STATE_ATTRIBUTES:
-                    state[name] = d[name] 
+                    state[name] = d[name]
                 self._parent._PyWrite("\n    # Saves context level %i %s" % (self._parent._contextlevel, state))
                 self._parent._contextlevel = self._parent._contextlevel + 1
-            elif self._action == "restoreState" :    
+            elif self._action == "restoreState" :
                 self._parent._contextlevel = self._parent._contextlevel - 1
                 self._parent._PyWrite("\n    # Restores context level %i %s" % (self._parent._contextlevel, self._parent._object.state_stack[-1]))
-            elif self._action == "beginForm" :    
+            elif self._action == "beginForm" :
                 self._parent._formnumber = self._parent._formnumber + 1
                 self._parent._PyWrite("\n    # Begins form %i" % self._parent._formnumber)
-            elif self._action == "endForm" :    
+            elif self._action == "endForm" :
                 self._parent._PyWrite("\n    # Ends form %i" % self._parent._formnumber)
-            elif self._action == "save" :    
+            elif self._action == "save" :
                 self._parent._PyWrite("\n    # Saves the PDF document to disk")
-        
+
         def _postcomment(self) :
             """Outputs comments after the method call."""
             if self._action == "showPage" :
                 self._parent._pagenumber = self._parent._pagenumber + 1
                 self._parent._PyWrite("\n    # Begins page %i" % self._parent._pagenumber)
-            elif self._action in [ "endForm", "drawPath", "clipPath" ] :    
+            elif self._action in [ "endForm", "drawPath", "clipPath" ] :
                 self._parent._PyWrite("")
 
     _name = "c"
@@ -277,14 +277,14 @@
         self._PyWrite(PyHeader)
         try :
             del kwargs["filename"]
-        except KeyError :    
+        except KeyError :
             pass
         self._PyWrite("    # create the PDF document\n    %s = Canvas(file, %s)\n\n    # Begins page 1" % (self._name, apply(buildargs, args[1:], kwargs)))
 
     def __nonzero__(self) :
         """This is needed by platypus' tables."""
         return 1
-        
+
     def __str__(self) :
         """Returns the equivalent Python source code."""
         if not self._footerpresent :
@@ -298,7 +298,7 @@
             return self.PathObject(self)
         elif name == "beginText" :
             return self.TextObject(self)
-        else :    
+        else :
             return self.Action(self, name)
 
     def _PyWrite(self, pycode) :
--- a/reportlab/platypus/para.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/platypus/para.py	Mon Nov 04 00:11:49 2002 +0000
@@ -127,7 +127,7 @@
             val = state[0]
             del state[0]
             setattr(self, var, val)
-    
+
     def format(self, maxwidth, maxheight, program, leading=0):
         "return program with line operations added if at least one line fits"
         # note: a generated formatted segment should not be formatted again
@@ -440,7 +440,7 @@
                     h.remove(handler)
                     self.lineOpHandlers = h
                     line.append(opcode)
-                
+
                 else:
                     raise ValueError, "at format time don't understand indicator "+repr(indicator)
             else:
@@ -516,7 +516,7 @@
                 result[-1] = expanded
             cursor = cursor+1
         return result
-    
+
 ##                if not first:
 ##                    #if debug: print "shifting", shift, e
 ##                    #result.append(shift)
@@ -586,7 +586,7 @@
             else:
                 result.append(e)
             index = index+1
-            
+
         return result
     def cleanProgram(self, line):
         "collapse adjacent spacings"
@@ -869,83 +869,83 @@
 from reportlab.lib.colors import black
 
 def readBool(text):
-	if string.upper(text) in ("Y", "YES", "TRUE", "1"):
-		return 1
-	elif string.upper(text) in ("N", "NO", "FALSE", "0"):
-		return 0
-	else:
-		raise RMLError, "true/false attribute has illegal value '%s'" % text
+    if string.upper(text) in ("Y", "YES", "TRUE", "1"):
+        return 1
+    elif string.upper(text) in ("N", "NO", "FALSE", "0"):
+        return 0
+    else:
+        raise RMLError, "true/false attribute has illegal value '%s'" % text
 
 def readAlignment(text):
-	from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY
-	up = string.upper(text)
-	if up == 'LEFT':
-		return TA_LEFT
-	elif up == 'RIGHT':
-		return TA_RIGHT
-	elif up in ['CENTER', 'CENTRE']:
-		return TA_CENTER
-	elif up == 'JUSTIFY':
-		return TA_JUSTIFY
+    from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY
+    up = string.upper(text)
+    if up == 'LEFT':
+        return TA_LEFT
+    elif up == 'RIGHT':
+        return TA_RIGHT
+    elif up in ['CENTER', 'CENTRE']:
+        return TA_CENTER
+    elif up == 'JUSTIFY':
+        return TA_JUSTIFY
 
 def readLength(text):
-	"""Read a dimension measurement: accept "3in", "5cm",
-	"72 pt" and so on."""
-	text = string.strip(text)
-	try:
-		return float(text)
-	except ValueError:
-		text = string.lower(text)
-		numberText, units = text[:-2],text[-2:]
-		numberText = string.strip(numberText)
-		try:
-			number = float(numberText)
-		except ValueError:
-			raise ValueError, "invalid length attribute '%s'" % text
-		try:
-			multiplier = {
-				'in':72,
-				'cm':28.3464566929,  #72/2.54; is this accurate?
-				'mm':2.83464566929,
-				'pt':1
-				}[units]
-		except KeyError:
-			raise RMLError, "invalid length attribute '%s'" % text
+    """Read a dimension measurement: accept "3in", "5cm",
+    "72 pt" and so on."""
+    text = string.strip(text)
+    try:
+        return float(text)
+    except ValueError:
+        text = string.lower(text)
+        numberText, units = text[:-2],text[-2:]
+        numberText = string.strip(numberText)
+        try:
+            number = float(numberText)
+        except ValueError:
+            raise ValueError, "invalid length attribute '%s'" % text
+        try:
+            multiplier = {
+                'in':72,
+                'cm':28.3464566929,  #72/2.54; is this accurate?
+                'mm':2.83464566929,
+                'pt':1
+                }[units]
+        except KeyError:
+            raise RMLError, "invalid length attribute '%s'" % text
 
-		return number * multiplier		   
+        return number * multiplier
 
 def lengthSequence(s, converter=readLength):
-	"""from "(2, 1)" or "2,1" return [2,1], for example"""
-	from string import split, strip
-	s = strip(s)
-	if s[:1]=="(" and s[-1:]==")":
-		s = s[1:-1]
-	sl = split(s, ",")
-	sl = map(strip, sl)
-	sl = map(converter, sl)
-	return sl
+    """from "(2, 1)" or "2,1" return [2,1], for example"""
+    from string import split, strip
+    s = strip(s)
+    if s[:1]=="(" and s[-1:]==")":
+        s = s[1:-1]
+    sl = split(s, ",")
+    sl = map(strip, sl)
+    sl = map(converter, sl)
+    return sl
 
 
 def readColor(text):
-	"""Read color names or tuples, RGB or CMYK, and return a Color object."""
-	if not text:
-		return None
-	from reportlab.lib import colors
-	if text[0] in string.letters:
-		return colors.__dict__[text]
-	tup = lengthSequence(text)
+    """Read color names or tuples, RGB or CMYK, and return a Color object."""
+    if not text:
+        return None
+    from reportlab.lib import colors
+    if text[0] in string.letters:
+        return colors.__dict__[text]
+    tup = lengthSequence(text)
 
-	msg = "Color tuple must have 3 (or 4) elements for RGB (or CMYC)."
-	assert 3 <= len(tup) <= 4, msg
-	msg = "Color tuple must have all elements <= 1.0."
-	for i in range(len(tup)):
-		assert tup[i] <= 1.0, msg
+    msg = "Color tuple must have 3 (or 4) elements for RGB (or CMYC)."
+    assert 3 <= len(tup) <= 4, msg
+    msg = "Color tuple must have all elements <= 1.0."
+    for i in range(len(tup)):
+        assert tup[i] <= 1.0, msg
 
-	if len(tup) == 3:
-		colClass = colors.Color
-	elif len(tup) == 4:
-		colClass = colors.CMYKColor
-	return apply(colClass, tup)
+    if len(tup) == 3:
+        colClass = colors.Color
+    elif len(tup) == 4:
+        colClass = colors.CMYKColor
+    return apply(colClass, tup)
 
 class StyleAttributeConverters:
     fontSize=[readLength]
@@ -960,7 +960,7 @@
     bulletIndent=[readLength]
     textColor=[readColor]
     backColor=[readColor]
-    
+
 class SimpleStyle:
     "simplified paragraph style without all the fancy stuff"
     name = "basic"
@@ -996,14 +996,14 @@
 
 
 DEFAULT_ALIASES = {
-	"h1.defaultStyle": "Heading1",
-	"h2.defaultStyle": "Heading2",
-	"h3.defaultStyle": "Heading3",
-	"title.defaultStyle": "Title",
-	"para.defaultStyle": "Normal",
-	"pre.defaultStyle": "Code",
-	"li.defaultStyle": "Definition"
-	}                
+    "h1.defaultStyle": "Heading1",
+    "h2.defaultStyle": "Heading2",
+    "h3.defaultStyle": "Heading3",
+    "title.defaultStyle": "Title",
+    "para.defaultStyle": "Normal",
+    "pre.defaultStyle": "Code",
+    "li.defaultStyle": "Definition"
+    }
 
 class FastPara(Flowable):
     "paragraph with no special features (not even a single ampersand!)"
@@ -1168,13 +1168,13 @@
         return self.style.spaceAfter
 
 def defaultContext():
-	result = {}
-	from reportlab.lib.styles import getSampleStyleSheet
-	styles = getSampleStyleSheet()
-	for (stylenamekey, stylenamevalue) in DEFAULT_ALIASES.items():
-		result[stylenamekey] = styles[stylenamevalue]
-	return result
-        
+    result = {}
+    from reportlab.lib.styles import getSampleStyleSheet
+    styles = getSampleStyleSheet()
+    for (stylenamekey, stylenamevalue) in DEFAULT_ALIASES.items():
+        result[stylenamekey] = styles[stylenamevalue]
+    return result
+
 class Para(Flowable):
     spaceBefore = 0
     spaceAfter = 0
@@ -1182,7 +1182,7 @@
         #print id(self), "para", parsedText
         self.baseindent = baseindent
         if context is None:
-			context = defaultContext()
+            context = defaultContext()
         self.context = context
         self.parsedText = parsedText
         self.bulletText = bulletText
@@ -1332,8 +1332,8 @@
             print "-"*44
         laststate = p.runOpCodes(formattedProgram, c, t)
         #print laststate["x"], laststate["y"]
-        c.drawText(t)        
-        
+        c.drawText(t)
+
     def compileProgram(self, parsedText, program=None):
         style = self.style1
         # standard parameters
@@ -1437,7 +1437,7 @@
         elif ttext is types.TupleType:
             (tagname, attdict, content, extra) = parsedText
             if not attdict:
-				attdict = {}
+                attdict = {}
             compilername = "compile_"+tagname
             compiler = getattr(self, compilername, None)
             if compiler is not None:
@@ -1477,7 +1477,7 @@
         if font!=oldfont:
             program.append( ("face", font ) )
         return oldfontinfo
-        
+
     def compile_(self, attdict, content, extra, program):
         # "anonymous" tag: just do the content
         for e in content:
@@ -1536,7 +1536,7 @@
                     newatts.update(attdict1)
                 bulletmaker.makeBullet(newatts)
                 self.compile_para(newatts, content1, extra, program)
-                
+
     def compile_ol(self, attdict, content, extra, program):
         return self.compile_ul(attdict, content, extra, program, tagname="ol")
 
@@ -1585,7 +1585,7 @@
                     bullet = "" # don't use this bullet again
         if bullet:
             raise ValueError, "dt will not be displayed unless followed by a dd"+repr(bullet)
-        
+
     def compile_super(self, attdict, content, extra, program):
         size = self.size
         self.size = newsize = size * 0.7
@@ -1815,7 +1815,7 @@
             return op
         elif attr.has_key('id'):
             id = attr['id']
-        else: 
+        else:
             id = None
         op = self.op = globalsequencer.nextf(id)
         return op
@@ -1837,7 +1837,7 @@
         globalsequencer.setDefaultCounter(default)
         self.op = ""
         return ""
-        
+
 class SeqResetObject(NameObject):
     def getOp(self, tuple, engine):
         from reportlab.lib.sequencer import getSequencer
@@ -1855,7 +1855,7 @@
         globalsequencer.reset(id, base)
         self.op = ""
         return ""
-    
+
 class GetNameObject(EvalStringObject):
     tagname = "getName"
 
@@ -1903,7 +1903,7 @@
         def translate(self, nodetuple, controller, context, overrides):
             thepara = ("para", {}, [nodetuple], None)
             return theParaMapper.translate(thepara, controller, context, overrides)
-        
+
     # override rml2pdf interpreters (should be moved to rml2pdf)
     theListMapper = ulMapper()
     Controller["ul"] = theListMapper
@@ -1923,22 +1923,22 @@
 <i>This is italic text.</i>
 
 <ul>
-	<li> this is an element at 1 
+    <li> this is an element at 1
 more text and even more text and on and on and so forth
 more text and even more text and on and on and so forth
 more text and even more text and on and on and so forth
 more text and even more text and on and on and so forth
 more text and even more text and on and on and so forth
 
-	<ul>
-		<li> this is an element at 2
-	
+    <ul>
+        <li> this is an element at 2
+
 more text and even more text and on and on and so forth
 more text and even more text and on and on and so forth
 
-		<ul>
-			<li> this is an element at 3
-		
+        <ul>
+            <li> this is an element at 3
+
 more text and even more text and on and on and so forth
 
 
@@ -1950,69 +1950,69 @@
 
 more text and even more text and on and on and so forth
 
-			<ul>
-				<li> this is an element at 4
-			
-more text and even more text and on and on and so forth
-more text and even more text and on and on and so forth
-
-				</li>
-			</ul>
+            <ul>
+                <li> this is an element at 4
 
 more text and even more text and on and on and so forth
 more text and even more text and on and on and so forth
 
-			</li>
-		</ul>
+                </li>
+            </ul>
+
 more text and even more text and on and on and so forth
 more text and even more text and on and on and so forth
 
-		</li>
+            </li>
+        </ul>
+more text and even more text and on and on and so forth
+more text and even more text and on and on and so forth
 
-	</ul>
+        </li>
+
+    </ul>
 <u><b>UNDERLINED</b> more text and even more text and on and on and so forth
 more text and even more text and on and on and so forth</u>
 
 <ol type="a">
-	<li>first element of the alpha list
+    <li>first element of the alpha list
 
- 	 <ul type="square">
-		<li>first element of the square unnumberred list</li>
+     <ul type="square">
+        <li>first element of the square unnumberred list</li>
 
-		<li>second element of the unnumberred list</li>
+        <li>second element of the unnumberred list</li>
 
-		<li>third element of the unnumberred list 
-		third element of the unnumberred list 
-		third element of the unnumberred list 
-		third element of the unnumberred list 
-		third element of the unnumberred list 
-		third element of the unnumberred list 	
-		third element of the unnumberred list 
-		</li>
+        <li>third element of the unnumberred list
+        third element of the unnumberred list
+        third element of the unnumberred list
+        third element of the unnumberred list
+        third element of the unnumberred list
+        third element of the unnumberred list
+        third element of the unnumberred list
+        </li>
 
-		<li>fourth element of the unnumberred list</li>
+        <li>fourth element of the unnumberred list</li>
 
-	  </ul>
+      </ul>
 
-	</li>
+    </li>
 
-	<li>second element of the alpha list</li>
+    <li>second element of the alpha list</li>
 
-	<li>third element of the alpha list 
-	third element of the unnumberred list 
-	third element of the unnumberred list 
-	third element of the unnumberred list 
-	third element of the unnumberred list 
-	third element of the unnumberred list 	
-	third element of the unnumberred list 
-	</li>
+    <li>third element of the alpha list
+    third element of the unnumberred list
+    third element of the unnumberred list
+    third element of the unnumberred list
+    third element of the unnumberred list
+    third element of the unnumberred list
+    third element of the unnumberred list
+    </li>
 
-	<li>fourth element of the alpha list</li>
+    <li>fourth element of the alpha list</li>
 
   </ol>
 
 
-	</li>
+    </li>
 </ul>
 
 <a href="http://www.reportlab.com">goto www.reportlab.com</a>.
@@ -2236,7 +2236,7 @@
         result.append(e+" ")
     return result
 
-testlink = HotLink("http://www.reportlab.com")        
+testlink = HotLink("http://www.reportlab.com")
 
 test_program = [
     ('push',),
@@ -2323,6 +2323,6 @@
             print "="*30, "x=", laststate["x"], "y=", laststate["y"]
     c.save()
     print fn
-                    
+
 if __name__=="__main__":
     test()
\ No newline at end of file
--- a/reportlab/setup.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/setup.py	Mon Nov 04 00:11:49 2002 +0000
@@ -15,7 +15,7 @@
             author="The boys from SW19",
             author_email="info@reportlab.com",
             url="http://www.reportlab.com/",
-          
+
             package_dir = {'': '..'},
 
             packages=[ # include anything with an __init__
@@ -48,7 +48,7 @@
                                      'fonts/luxiserif.ttf',
                                      'fonts/rina.ttf']
                      )],
-            
+
             ext_modules =   [Extension( '_rl_accel',
                                         ['lib/_rl_accel.c'],
                                         include_dirs=[],
--- a/reportlab/setup_reportlab.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/setup_reportlab.py	Mon Nov 04 00:11:49 2002 +0000
@@ -25,7 +25,7 @@
                     'reportlab.demos.odyssey',
                     'reportlab.demos.rlzope',
                     'reportlab.demos.stdfonts',
-                    'reportlab.demos.tests',                    
+                    'reportlab.demos.tests',
                     'reportlab.docs',
                     'reportlab.docs.graphguide',
                     'reportlab.docs.reference',
--- a/reportlab/test/test_platypus_paragraphs.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/test/test_platypus_paragraphs.py	Mon Nov 04 00:11:49 2002 +0000
@@ -1,7 +1,7 @@
 #copyright ReportLab Inc. 2000-2001
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/test/test_platypus_paragraphs.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/test/test_platypus_paragraphs.py,v 1.10 2002/11/03 14:50:43 rgbecker Exp $
+#$Header: /tmp/reportlab/reportlab/test/test_platypus_paragraphs.py,v 1.11 2002/11/04 00:11:49 andy_robinson Exp $
 """Tests for the reportlab.platypus.paragraphs module.
 """
 
@@ -72,10 +72,10 @@
 so that once the bottom of the image is reached, then text will flow back to the
 left margin. I know that it would be possible to something like this
 using tables, but I can't see how to have a generic solution.
-There are two examples of this in the demonstration section of the reportlab 
+There are two examples of this in the demonstration section of the reportlab
 site.
-If you look at the "minimal" euro python conference brochure, at the end of the 
-timetable section (page 8), there are adverts for "AdSu" and "O'Reilly". I can 
+If you look at the "minimal" euro python conference brochure, at the end of the
+timetable section (page 8), there are adverts for "AdSu" and "O'Reilly". I can
 see how the AdSu one might be done generically, but the O'Reilly, unsure...
 I guess I'm hoping that I've missed something, and that
 it's actually easy to do using platypus.
--- a/reportlab/test/test_renderSVG.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/test/test_renderSVG.py	Mon Nov 04 00:11:49 2002 +0000
@@ -37,9 +37,9 @@
     HAVE_XML_PARSER = 1
 except SAXReaderNotAvailable:
     HAVE_XML_PARSER = 0
-    
-     
-    
+
+
+
 
 def load(path):
     "Helper function to read the generated SVG again."
@@ -67,7 +67,7 @@
         if not HAVE_XML_PARSER:
             warnIgnoredRestofTest()
             return
-            
+
         svg = load(path)
         fg = svg.getElementsByTagName('g')[0]           # flipping group
         dg = fg.getElementsByTagName('g')[0]            # diagram group
@@ -93,7 +93,7 @@
         if not HAVE_XML_PARSER:
             warnIgnoredRestofTest()
             return
-            
+
         svg = load(path)
         fg = svg.getElementsByTagName('g')[0]           # flipping group
         dg = fg.getElementsByTagName('g')[0]            # diagram group
@@ -123,7 +123,7 @@
         if not HAVE_XML_PARSER:
             warnIgnoredRestofTest()
             return
-            
+
         svg = load(path)
         fg = svg.getElementsByTagName('g')[0]           # flipping group
         dg = fg.getElementsByTagName('g')[0]            # diagram group
--- a/reportlab/test/test_source_chars.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/test/test_source_chars.py	Mon Nov 04 00:11:49 2002 +0000
@@ -2,7 +2,7 @@
 #copyright ReportLab Inc. 2000-2001
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/test/test_source_chars.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/test/test_source_chars.py,v 1.2 2002/07/24 19:56:38 andy_robinson Exp $
+#$Header: /tmp/reportlab/reportlab/test/test_source_chars.py,v 1.3 2002/11/04 00:11:49 andy_robinson Exp $
 
 """This tests for things in source files.  Initially, absence of tabs :-)
 """
@@ -58,10 +58,20 @@
         return
     w = GlobDirectoryWalker(dirname, '*.py')
     for filename in w:
-        lines = open(filename, 'r').readlines()
-        lines = map(string.rstrip, lines)
-        open(filename, 'w').write(string.join(lines, '\n'))
-        print 'processed %s' % filename
+        # trim off final newline and detect real changes
+        txt = open(filename, 'r').read()
+        badChars = 0
+        cleaned = []
+        for line in string.split(txt, '\n'):
+            stripped = string.rstrip(line)
+            cleaned.append(stripped)
+            spaces = len(line) - len(stripped)  # OK, so they might be trailing tabs, who cares?
+            if spaces:
+                badChars = badChars + spaces
+
+        if badChars <> 0:
+            open(filename, 'w').write(string.join(cleaned, '\n'))
+            print "file %s contained %d trailing spaces, FIXED" % (filename, badChars)
     print 'done'
 
 def makeSuite():
--- a/reportlab/tools/pythonpoint/pythonpoint.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/tools/pythonpoint/pythonpoint.py	Mon Nov 04 00:11:49 2002 +0000
@@ -971,7 +971,7 @@
                'silent':0,
                'outDir': None}
 
-    args = sys.argv[1:] 
+    args = sys.argv[1:]
     args = filter(lambda x: x and x[0]=='-',args) + filter(lambda x: not x or x[0]!='-',args)
     try:
         shortOpts = 'hnvs'
--- a/reportlab/tools/pythonpoint/stdparser.py	Sun Nov 03 23:47:05 2002 +0000
+++ b/reportlab/tools/pythonpoint/stdparser.py	Mon Nov 04 00:11:49 2002 +0000
@@ -18,7 +18,7 @@
 def getModule(modulename,fromPath='reportlab.tools.pythonpoint.styles'):
     """Get a module containing style declarations.
 
-    Search order is: 
+    Search order is:
         reportlab/tools/pythonpoint/
         reportlab/tools/pythonpoint/styles/
         ./