Changed attribute postponed to _postponed in doctemplate.py.
authordinu_gherman
Tue, 13 Mar 2001 08:38:12 +0000
changeset 698 864265047890
parent 697 6228e955353f
child 699 9b2caf9e544d
Changed attribute postponed to _postponed in doctemplate.py. Added minor changes in shapes.py. Changed test_graphics_charts.py to no longer use page breaks.
reportlab/graphics/shapes.py
reportlab/platypus/doctemplate.py
reportlab/test/test_graphics_charts.py
--- a/reportlab/graphics/shapes.py	Tue Mar 13 07:39:56 2001 +0000
+++ b/reportlab/graphics/shapes.py	Tue Mar 13 08:38:12 2001 +0000
@@ -321,8 +321,9 @@
                 if checkerFunc:
                     value = getattr(self, attr)
                     assert checkerFunc(value), "Invalid value %s for attribute %s in class %s" % (value, attr, self.__class__.__name__)
+
     if shapeChecking:
-        """This adds the ability to check every attribite assignment as it is made.
+        """This adds the ability to check every attribute assignment as it is made.
         It slows down shapes but is a big help when developing. It does not
         get defined if config.shapeChecking = 0"""
         #print 'shapeChecking = 1, defining setattr'
@@ -330,7 +331,7 @@
             """By default we verify.  This could be off
             in some parallel base classes."""
             if self._attrMap is not None:
-                if attr[0:1] <> '_':
+                if attr[0] <> '_':
                     try:
                         checker = self._attrMap[attr]
                         if checker:
@@ -344,6 +345,7 @@
     #else:
     #    print 'shapeChecking = 0, not defining setattr'
 
+
 class Drawing(Shape, Flowable):
     """Outermost container; the thing a renderer works on.
     This has no properties except a height, width and list
@@ -885,4 +887,4 @@
 
 if __name__=='__main__':
     test()
-    
\ No newline at end of file
+    
--- a/reportlab/platypus/doctemplate.py	Tue Mar 13 07:39:56 2001 +0000
+++ b/reportlab/platypus/doctemplate.py	Tue Mar 13 08:38:12 2001 +0000
@@ -1,9 +1,9 @@
 #copyright ReportLab Inc. 2000
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/platypus/doctemplate.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/platypus/doctemplate.py,v 1.37 2001/03/07 18:57:11 rgbecker Exp $
+#$Header: /tmp/reportlab/reportlab/platypus/doctemplate.py,v 1.38 2001/03/13 08:38:11 dinu_gherman Exp $
 
-__version__=''' $Id: doctemplate.py,v 1.37 2001/03/07 18:57:11 rgbecker Exp $ '''
+__version__=''' $Id: doctemplate.py,v 1.38 2001/03/13 08:38:11 dinu_gherman Exp $ '''
 
 __doc__="""
 This module contains the core structure of platypus.
@@ -413,7 +413,8 @@
 						flowables.insert(f,S[f])	# put split flowables back on the list
 				else:
 					# this must be cleared when they are finally drawn!
-					if hasattr(f,'postponed'):
+##					if hasattr(f,'postponed'):
+					if hasattr(f,'_postponed'):
 						message = "Flowable %s too large on page %d" % (f, self.page)
 						#show us, it might be handy
 						#HACK = it seems within tables we sometimes
@@ -423,7 +424,8 @@
 							print 'Offending Paragraph:'
 							print f.getPlainText()
 						raise "LayoutError", message
-					f.postponed = 1
+##					f.postponed = 1
+					f._postponed = 1
 					flowables.insert(0,f)			# put the flowable back
 					self.handle_frameEnd()
 
@@ -528,8 +530,10 @@
 			#packer might have tacked an attribute onto some
 			#paragraphs
 			for elem in story:
-				if hasattr(elem, 'postponed'):
-					del elem.postponed
+##				if hasattr(elem, 'postponed'):
+##					del elem.postponed
+				if hasattr(elem, '_postponed'):
+					del elem._postponed
 
 			for fl in self._indexingFlowables:
 				fl.afterBuild()
--- a/reportlab/test/test_graphics_charts.py	Tue Mar 13 07:39:56 2001 +0000
+++ b/reportlab/test/test_graphics_charts.py	Tue Mar 13 08:38:12 2001 +0000
@@ -200,7 +200,6 @@
         drawing = sample1bar()
         story.append(drawing)
         story.append(Spacer(0, 1*cm))
-        story.append(PageBreak())
         
 
     def test2(self):
@@ -213,7 +212,6 @@
         drawing = sample2bar()
         story.append(drawing)
         story.append(Spacer(0, 1*cm))
-        story.append(PageBreak())
         
 
     def test3(self):
@@ -227,7 +225,6 @@
         drawing = sample3(drawing)
         story.append(drawing)
         story.append(Spacer(0, 1*cm))
-        story.append(PageBreak())
 
         
     def test4(self):
@@ -240,7 +237,6 @@
         drawing = sample1line()
         story.append(drawing)
         story.append(Spacer(0, 1*cm))
-        story.append(PageBreak())
         
 
     def test5(self):
@@ -253,7 +249,6 @@
         drawing = sample2line()
         story.append(drawing)
         story.append(Spacer(0, 1*cm))
-        story.append(PageBreak())
         
 
     def test6(self):
@@ -266,7 +261,6 @@
         drawing = sample4pie()
         story.append(drawing)
         story.append(Spacer(0, 1*cm))
-        story.append(PageBreak())
 
         # This triggers the document build operation (hackish).
         global FINISHED