Renamed BasicFrame to Frame
authorrgbecker
Wed, 17 May 2000 22:18:09 +0000
changeset 227 fa5b4d81f471
parent 226 a9acb67cdef7
child 228 d3aaff565043
Renamed BasicFrame to Frame
reportlab/demos/odyssey/dodyssey.py
reportlab/demos/pythonpoint/pythonpoint.py
reportlab/platypus/doctemplate.py
reportlab/platypus/layout.py
reportlab/platypus/test/testplatypus.py
utils/yaml/platdemos.py
utils/yaml/platprop.yml
utils/yaml/yaml2pdf.py
--- a/reportlab/demos/odyssey/dodyssey.py	Wed May 17 16:30:09 2000 +0000
+++ b/reportlab/demos/odyssey/dodyssey.py	Wed May 17 22:18:09 2000 +0000
@@ -31,9 +31,12 @@
 #
 ###############################################################################
 #	$Log: dodyssey.py,v $
+#	Revision 1.5  2000/05/17 22:15:58  rgbecker
+#	Renamed BasicFrame to Frame
+#
 #	Revision 1.4  2000/05/13 09:23:45  rgbecker
 #	Fix spacing bugs
-#
+#	
 #	Revision 1.3  2000/05/12 16:19:07  rgbecker
 #	Title leading changes
 #	
@@ -55,7 +58,7 @@
 #	Revision 1.1  2000/04/06 08:58:09  rgbecker
 #	Paragraph formatting version of odyssey.py
 #	
-__version__=''' $Id: dodyssey.py,v 1.4 2000/05/13 09:23:45 rgbecker Exp $ '''
+__version__=''' $Id: dodyssey.py,v 1.5 2000/05/17 22:15:58 rgbecker Exp $ '''
 __doc__=''
 
 #REPORTLAB_TEST_SCRIPT
@@ -85,11 +88,11 @@
 	doc = doctemplate.BaseDocTemplate('dodyssey.pdf',showBoundary=0)
 
 	#normal frame as for SimpleFlowDocument
-	frameT = doctemplate.BasicFrame(doc.leftMargin, doc.bottomMargin, doc.width, doc.height, id='normal')
+	frameT = doctemplate.Frame(doc.leftMargin, doc.bottomMargin, doc.width, doc.height, id='normal')
 
 	#Two Columns
-	frame1 = doctemplate.BasicFrame(doc.leftMargin, doc.bottomMargin, doc.width/2-6, doc.height, id='col1')
-	frame2 = doctemplate.BasicFrame(doc.leftMargin+doc.width/2+6, doc.bottomMargin, doc.width/2-6,
+	frame1 = doctemplate.Frame(doc.leftMargin, doc.bottomMargin, doc.width/2-6, doc.height, id='col1')
+	frame2 = doctemplate.Frame(doc.leftMargin+doc.width/2+6, doc.bottomMargin, doc.width/2-6,
 						doc.height, id='col2')
 	doc.addPageTemplates([doctemplate.PageTemplate(id='First',frames=frameT, onPage=myTitlePage),
 						doctemplate.PageTemplate(id='OneCol',frames=frameT, onPage=myLaterPages),
--- a/reportlab/demos/pythonpoint/pythonpoint.py	Wed May 17 16:30:09 2000 +0000
+++ b/reportlab/demos/pythonpoint/pythonpoint.py	Wed May 17 22:18:09 2000 +0000
@@ -31,9 +31,12 @@
 #
 ###############################################################################
 #	$Log: pythonpoint.py,v $
+#	Revision 1.18  2000/05/17 22:17:38  rgbecker
+#	Renamed BasicFrame to Frame
+#
 #	Revision 1.17  2000/05/17 16:29:40  rgbecker
 #	Removal of SimpleFrame
-#
+#	
 #	Revision 1.16  2000/05/16 23:48:00  andy_robinson
 #	Allowed intra-paragraph text; fixed various bugs
 #	
@@ -87,7 +90,7 @@
 #	Revision 1.1.1.1  2000/02/15 15:08:55  rgbecker
 #	Initial setup of demos directory and contents.
 #	
-__version__=''' $Id: pythonpoint.py,v 1.17 2000/05/17 16:29:40 rgbecker Exp $ '''
+__version__=''' $Id: pythonpoint.py,v 1.18 2000/05/17 22:17:38 rgbecker Exp $ '''
 # xml parser stuff for PythonPoint
 # PythonPoint Markup Language!
 __doc__="""
@@ -240,11 +243,11 @@
 
     def drawOn(self, canv):
         #make a layout frame
-        frame = layout.BasicFrame( self.x,
-                                   self.y,
-                                   self.width,
-                                   self.height,
-                                   showBoundary=1)
+        frame = layout.Frame( self.x,
+                              self.y,
+                              self.width,
+                              self.height,
+                              showBoundary=1)
  
         #build a story for the frame
         story = []
--- a/reportlab/platypus/doctemplate.py	Wed May 17 16:30:09 2000 +0000
+++ b/reportlab/platypus/doctemplate.py	Wed May 17 22:18:09 2000 +0000
@@ -31,9 +31,12 @@
 #
 ###############################################################################
 #	$Log: doctemplate.py,v $
+#	Revision 1.11  2000/05/17 22:17:38  rgbecker
+#	Renamed BasicFrame to Frame
+#
 #	Revision 1.10  2000/05/17 16:29:40  rgbecker
 #	Removal of SimpleFrame
-#
+#	
 #	Revision 1.9  2000/05/17 15:37:33  rgbecker
 #	Changes related to removal of SimpleFlowDocument
 #	
@@ -61,7 +64,7 @@
 #	Revision 1.1  2000/05/12 12:53:33  rgbecker
 #	Initial try at a document template class
 #	
-__version__=''' $Id: doctemplate.py,v 1.10 2000/05/17 16:29:40 rgbecker Exp $ '''
+__version__=''' $Id: doctemplate.py,v 1.11 2000/05/17 22:17:38 rgbecker Exp $ '''
 __doc__="""
 More complicated Document model
 """
@@ -106,13 +109,13 @@
 
 class PageTemplate:
 	"""
-	essentially a list of BasicFrames and an onPage routine to call at the start
+	essentially a list of Frames and an onPage routine to call at the start
 	of a page when this is selected.
 	derived classes can also implement drawPage if they want
 	"""
 	def __init__(self,id=None,frames=[],onPage=None):
 		if type(frames) not in (ListType,TupleType): frames = [frames]
-		assert filter(lambda x: not isinstance(x,BasicFrame), frames)==[], "frames argument error"
+		assert filter(lambda x: not isinstance(x,Frame), frames)==[], "frames argument error"
 		self.id = id
 		self.frames = frames
 		self.onPage = onPage or _doNothing
@@ -338,7 +341,7 @@
 		self._handle_nextPageTemplate('Later')
 
 	def build(self,flowables,onFirstPage=_doNothing, onLaterPages=_doNothing):
-		frameT = BasicFrame(self.leftMargin, self.bottomMargin, self.width, self.height, id='normal')
+		frameT = Frame(self.leftMargin, self.bottomMargin, self.width, self.height, id='normal')
 		self.addPageTemplates([PageTemplate(id='First',frames=frameT, onPage=onFirstPage),
 						PageTemplate(id='Later',frames=frameT, onPage=onLaterPages)])
 		if onFirstPage is _doNothing and hasattr(self,'onFirstPage'):
--- a/reportlab/platypus/layout.py	Wed May 17 16:30:09 2000 +0000
+++ b/reportlab/platypus/layout.py	Wed May 17 22:18:09 2000 +0000
@@ -31,9 +31,12 @@
 #
 ###############################################################################
 #	$Log: layout.py,v $
+#	Revision 1.28  2000/05/17 22:17:38  rgbecker
+#	Renamed BasicFrame to Frame
+#
 #	Revision 1.27  2000/05/17 16:29:40  rgbecker
 #	Removal of SimpleFrame
-#
+#	
 #	Revision 1.26  2000/05/16 16:15:16  rgbecker
 #	Changes related to removal of SimpleFlowDocument
 #	
@@ -110,7 +113,7 @@
 #	Revision 1.2  2000/02/15 15:47:09  rgbecker
 #	Added license, __version__ and Logi comment
 #	
-__version__=''' $Id: layout.py,v 1.27 2000/05/17 16:29:40 rgbecker Exp $ '''
+__version__=''' $Id: layout.py,v 1.28 2000/05/17 22:17:38 rgbecker Exp $ '''
 __doc__="""
 Page Layout And TYPography Using Scripts
 a page layout API on top of PDFgen
@@ -312,7 +315,7 @@
 	def draw(self):
 		exec self.command in globals(), {'canvas':self.canv}
 
-class BasicFrame:
+class Frame:
 	'''Abstraction for the definitional part of a Frame
 
                 width                    x2,y2
--- a/reportlab/platypus/test/testplatypus.py	Wed May 17 16:30:09 2000 +0000
+++ b/reportlab/platypus/test/testplatypus.py	Wed May 17 22:18:09 2000 +0000
@@ -31,9 +31,12 @@
 #
 ###############################################################################
 #	$Log: testplatypus.py,v $
+#	Revision 1.16  2000/05/17 22:17:38  rgbecker
+#	Renamed BasicFrame to Frame
+#
 #	Revision 1.15  2000/05/16 14:28:55  rgbecker
 #	Fixes/Changes to get testplatypus to work with new framework
-#
+#	
 #	Revision 1.14  2000/04/26 11:07:15  andy_robinson
 #	Tables changed to use reportlab.lib.colors instead of
 #	the six hard-coded color strings there previously.
@@ -74,7 +77,7 @@
 #	Revision 1.2  2000/02/15 15:47:10  rgbecker
 #	Added license, __version__ and Logi comment
 #	
-__version__=''' $Id: testplatypus.py,v 1.15 2000/05/16 14:28:55 rgbecker Exp $ '''
+__version__=''' $Id: testplatypus.py,v 1.16 2000/05/17 22:17:38 rgbecker Exp $ '''
 
 #tests and documents Page Layout API
 __doc__="""This is not obvious so here's a brief explanation.  This module is both
@@ -469,8 +472,8 @@
 	def __init__(self, filename, pagesize=layout.DEFAULT_PAGE_SIZE, showBoundary=0,
 				leftMargin=inch, rightMargin=inch, topMargin=inch, bottomMargin=inch,
 				allowSplitting=0):
-		frame1 = layout.BasicFrame(inch, 5.6*inch, 6*inch, 5.2*inch,id='F1')
-		frame2 = layout.BasicFrame(inch, inch, 6*inch, 4.5*inch, showBoundary=1,id='F2')
+		frame1 = layout.Frame(inch, 5.6*inch, 6*inch, 5.2*inch,id='F1')
+		frame2 = layout.Frame(inch, inch, 6*inch, 4.5*inch, showBoundary=1,id='F2')
 		BaseDocTemplate.__init__(self, filename, pagesize=pagesize,
 				pageTemplates=PageTemplate('normal',[frame1,frame2],framePage),
 				showBoundary=showBoundary, leftMargin=leftMargin, rightMargin=rightMargin,
--- a/utils/yaml/platdemos.py	Wed May 17 16:30:09 2000 +0000
+++ b/utils/yaml/platdemos.py	Wed May 17 22:18:09 2000 +0000
@@ -3,7 +3,7 @@
 from reportlab.lib import colors
 from reportlab.pdfgen.canvas import Canvas
 from reportlab.lib.styles import ParagraphStyle
-from reportlab.platypus.layout import BasicFrame, Flowable
+from reportlab.platypus.layout import Frame, Flowable
 from reportlab.platypus.paragraph import Paragraph
 from reportlab.lib.units import inch
 from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER
@@ -98,7 +98,7 @@
 
 
 def demo1(canvas):
-    frame = BasicFrame(
+    frame = Frame(
                     2*inch,     # x
                     4*inch,     # y at bottom
                     4*inch,     # width
@@ -124,7 +124,7 @@
 
 def test1():
     c  = Canvas('platdemos.pdf')
-    f = BasicFrame(inch, inch, 6*inch, 9*inch, showBoundary=1)
+    f = Frame(inch, inch, 6*inch, 9*inch, showBoundary=1)
     v = PlatPropFigure1()
     f.addFromList([v],c)
     c.save()
--- a/utils/yaml/platprop.yml	Wed May 17 16:30:09 2000 +0000
+++ b/utils/yaml/platprop.yml	Wed May 17 22:18:09 2000 +0000
@@ -4,6 +4,9 @@
 CVS Revision History
 .beginPre Code
 $Log: platprop.yml,v $
+Revision 1.7  2000/05/17 22:18:09  rgbecker
+Renamed BasicFrame to Frame
+
 Revision 1.6  2000/05/17 16:30:09  rgbecker
 Removal of SimpleFrame
 
@@ -72,8 +75,7 @@
 .beginPre Code 
     canvas = Canvas('figure1.pdf')
 
-    frame = SimpleFrame(
-                    canvas,
+    frame = Frame(
                     2*inch,     # x
                     4*inch,     # y at bottom
                     4*inch,     # width
@@ -92,7 +94,7 @@
 
     mydata = [para1, para2]
 
-    frame.addFromList(mydata)
+    frame.addFromList(mydata,canvas)
     canvas.save()
 .endPre
 
@@ -100,15 +102,15 @@
 
 .custom platdemos PlatPropFigure1
 
-SimpleFrame has an <i>addFromList</i> method to display content.  It consumes objects from the front of the list until no more can fit in its client area or until the list is empty.
+Frame has an <i>addFromList</i> method to display content.  It consumes objects from the front of the list until no more can fit in its client area or until the list is empty.
 
 Note that there is a certain amount of space between the frame and the paragraphs within it.  Frames have four 'padding' attributes which can control this. The attributes can be seen below in the method signature for initializing a frame.
 
-.Comment  At the moment we have a BasicFrame class which defines the space a frame will take up and which isu used by DocTenplate; SimpleFrame descends from this and has the addFromList method to allow one to create and use a frame as we did above.  We hope to abolish the distinction so users interact with a class called Frame or BaseFrame.
+.Comment  At the moment we have a Frame class which defines the space a frame will take up and which is used by DocTemplate; SimpleFrame descends from this and has the addFromList method to allow one to create and use a frame as we did above.  We hope to abolish the distinction so users interact with a class called Frame or BaseFrame.
 
 
 .beginPre Code
-class BasicFrame:
+class Frame:
 	'''Abstraction for the definitional part of a Frame
 
                 width                    x2,y2
@@ -366,7 +368,7 @@
 
 class MyPageTemplate(PageTemplate):
     def __init__(self, id):
-        myFrame = BasicFrame(inch, inch, 6*inch, 10*inch, id='normal')
+        myFrame = Frame(inch, inch, 6*inch, 10*inch, id='normal')
         PageTemplate.__init__(self, id, [myFrame], onPage=decoratePage)
 
 .endPre
@@ -377,7 +379,7 @@
 .beginPre Code
 class MyPageTemplate(PageTemplate):
     def __init__(self, id):
-        myFrame = BasicFrame(inch, inch, 6*inch, 10*inch, id='normal')
+        myFrame = Frame(inch, inch, 6*inch, 10*inch, id='normal')
         PageTemplate.__init__(self, id, [myFrame])  # note lack of onPage
 
     def drawPage(self, canvas, doc):
--- a/utils/yaml/yaml2pdf.py	Wed May 17 16:30:09 2000 +0000
+++ b/utils/yaml/yaml2pdf.py	Wed May 17 22:18:09 2000 +0000
@@ -35,7 +35,7 @@
 
 class MyPageTemplate(PageTemplate):
     def __init__(self, id):
-        myFrame = BasicFrame(inch, inch, 6*inch, 10*inch, id='normal')
+        myFrame = Frame(inch, inch, 6*inch, 10*inch, id='normal')
         PageTemplate.__init__(self, id, [myFrame])  # note lack of onPage
 
     def drawPage(self, canvas, doc):