pageSize is wrong at present
authorrgbecker
Thu, 01 Jun 2000 16:28:35 +0000
changeset 255 ee9e321e747d
parent 254 adc041d2e4b9
child 256 0dedfa161b21
pageSize is wrong at present
reportlab/demos/gadflypaper/gfe.py
reportlab/demos/odyssey/fodyssey.py
reportlab/platypus/doctemplate.py
reportlab/platypus/flowables.py
reportlab/platypus/test/testtables.py
utils/yaml/platprop.yml
utils/yaml/yaml2pdf.py
--- a/reportlab/demos/gadflypaper/gfe.py	Thu Jun 01 15:30:45 2000 +0000
+++ b/reportlab/demos/gadflypaper/gfe.py	Thu Jun 01 16:28:35 2000 +0000
@@ -31,9 +31,12 @@
 #
 ###############################################################################
 #	$Log: gfe.py,v $
+#	Revision 1.11  2000/06/01 16:27:56  rgbecker
+#	pageSize is wrong at present
+#
 #	Revision 1.10  2000/06/01 15:23:06  rgbecker
 #	Platypus re-organisation
-#
+#	
 #	Revision 1.9  2000/05/17 15:37:33  rgbecker
 #	Changes related to removal of SimpleFlowDocument
 #	
@@ -61,7 +64,7 @@
 #	Revision 1.1.1.1  2000/02/15 15:15:57  rgbecker
 #	Initial setup of demos directory and contents.
 #	
-__version__=''' $Id: gfe.py,v 1.10 2000/06/01 15:23:06 rgbecker Exp $ '''
+__version__=''' $Id: gfe.py,v 1.11 2000/06/01 16:27:56 rgbecker Exp $ '''
 __doc__=''
 
 #REPORTLAB_TEST_SCRIPT
@@ -118,7 +121,7 @@
     
 def go():
     Elements.insert(0,Spacer(0,inch))
-    doc = SimpleDocTemplate('gfe.pdf',pageSize=DEFAULT_PAGE_SIZE)
+    doc = SimpleDocTemplate('gfe.pdf')
     doc.build(Elements,onFirstPage=myFirstPage, onLaterPages=myLaterPages)
 
 Elements = []
--- a/reportlab/demos/odyssey/fodyssey.py	Thu Jun 01 15:30:45 2000 +0000
+++ b/reportlab/demos/odyssey/fodyssey.py	Thu Jun 01 16:28:35 2000 +0000
@@ -31,9 +31,12 @@
 #
 ###############################################################################
 #	$Log: fodyssey.py,v $
+#	Revision 1.13  2000/06/01 16:27:56  rgbecker
+#	pageSize is wrong at present
+#
 #	Revision 1.12  2000/06/01 15:23:06  rgbecker
 #	Platypus re-organisation
-#
+#	
 #	Revision 1.11  2000/06/01 09:41:12  rgbecker
 #	test filename case fix
 #	
@@ -67,7 +70,7 @@
 #	Revision 1.1  2000/04/06 08:58:09  rgbecker
 #	Paragraph formatting version of odyssey.py
 #	
-__version__=''' $Id: fodyssey.py,v 1.12 2000/06/01 15:23:06 rgbecker Exp $ '''
+__version__=''' $Id: fodyssey.py,v 1.13 2000/06/01 16:27:56 rgbecker Exp $ '''
 __doc__=''
 
 #REPORTLAB_TEST_SCRIPT
@@ -94,7 +97,7 @@
 	canvas.restoreState()
 	
 def go():
-	doc = SimpleDocTemplate('fodyssey.pdf',pageSize=DEFAULT_PAGE_SIZE,showBoundary='showboundary' in sys.argv)
+	doc = SimpleDocTemplate('fodyssey.pdf',showBoundary='showboundary' in sys.argv)
 	doc.allowSplitting = not 'nosplitting' in sys.argv
 	doc.build(Elements,myFirstPage,myLaterPages)
 
--- a/reportlab/platypus/doctemplate.py	Thu Jun 01 15:30:45 2000 +0000
+++ b/reportlab/platypus/doctemplate.py	Thu Jun 01 16:28:35 2000 +0000
@@ -31,9 +31,12 @@
 #
 ###############################################################################
 #	$Log: doctemplate.py,v $
+#	Revision 1.14  2000/06/01 16:27:56  rgbecker
+#	pageSize is wrong at present
+#
 #	Revision 1.13  2000/06/01 15:23:06  rgbecker
 #	Platypus re-organisation
-#
+#	
 #	Revision 1.12  2000/05/26 10:27:37  rgbecker
 #	Fixed infinite recursion bug
 #	
@@ -70,7 +73,7 @@
 #	Revision 1.1  2000/05/12 12:53:33  rgbecker
 #	Initial try at a document template class
 #	
-__version__=''' $Id: doctemplate.py,v 1.13 2000/06/01 15:23:06 rgbecker Exp $ '''
+__version__=''' $Id: doctemplate.py,v 1.14 2000/06/01 16:27:56 rgbecker Exp $ '''
 __doc__="""
 More complicated Document model
 """
@@ -99,10 +102,14 @@
 	def apply(self,doc):
 		action = self.action[0]
 		args = tuple(self.action[1:])
+		arn = 'handle_'+action
 		try:
-			apply(getattr(doc,'handle_'+action), args)
-		except AttributeError:
-			raise NotImplementedError, "Can't handle ActionFlowable(%s)" % action
+			apply(getattr(doc,arn), args)
+		except AttributeError, aerr:
+			if aerr.args[0]==arn:
+				raise NotImplementedError, "Can't handle ActionFlowable(%s)" % action
+			else:
+				raise
 		except:
 			t, v, None = sys.exc_info()
 			raise t, "%s\n   handle_%s args=%s"%(v,action,args)
@@ -156,7 +163,7 @@
 
 	4)	The document instances can override the base handler routines.
 	"""
-	_initArgs = {	'pageSize':DEFAULT_PAGE_SIZE,
+	_initArgs = {	'pagesize':DEFAULT_PAGE_SIZE,
 					'pageTemplates':[],
 					'showBoundary':0,
 					'leftMargin':inch,
@@ -187,8 +194,8 @@
 		self._calc()
 
 	def _calc(self):
-		self._rightMargin = self.pageSize[0] - self.rightMargin
-		self._topMargin = self.pageSize[1] - self.topMargin
+		self._rightMargin = self.pagesize[0] - self.rightMargin
+		self._topMargin = self.pagesize[1] - self.topMargin
 		self.width = self._rightMargin - self.leftMargin
 		self.height = self._topMargin - self.bottomMargin
 
--- a/reportlab/platypus/flowables.py	Thu Jun 01 15:30:45 2000 +0000
+++ b/reportlab/platypus/flowables.py	Thu Jun 01 16:28:35 2000 +0000
@@ -31,11 +31,14 @@
 #
 ###############################################################################
 #	$Log: flowables.py,v $
+#	Revision 1.2  2000/06/01 16:27:56  rgbecker
+#	pageSize is wrong at present
+#
 #	Revision 1.1  2000/06/01 15:23:06  rgbecker
 #	Platypus re-organisation
-#
+#	
 #	
-__version__=''' $Id: flowables.py,v 1.1 2000/06/01 15:23:06 rgbecker Exp $ '''
+__version__=''' $Id: flowables.py,v 1.2 2000/06/01 16:27:56 rgbecker Exp $ '''
 __doc__="""
 """
 
@@ -262,4 +265,4 @@
 	def draw(self):
 		exec self.command in globals(), {'canvas':self.canv}
 
-from paragraph import Paragraph
+#from paragraph import Paragraph
--- a/reportlab/platypus/test/testtables.py	Thu Jun 01 15:30:45 2000 +0000
+++ b/reportlab/platypus/test/testtables.py	Thu Jun 01 16:28:35 2000 +0000
@@ -32,9 +32,12 @@
 #
 ###############################################################################
 #	$Log: testtables.py,v $
+#	Revision 1.10  2000/06/01 16:27:56  rgbecker
+#	pageSize is wrong at present
+#
 #	Revision 1.9  2000/06/01 15:23:06  rgbecker
 #	Platypus re-organisation
-#
+#	
 #	Revision 1.8  2000/05/17 15:37:33  rgbecker
 #	Changes related to removal of SimpleFlowDocument
 #	
@@ -57,7 +60,7 @@
 #	Revision 1.2  2000/02/15 15:47:10  rgbecker
 #	Added license, __version__ and Logi comment
 #
-__version__=''' $Id: testtables.py,v 1.9 2000/06/01 15:23:06 rgbecker Exp $ '''
+__version__=''' $Id: testtables.py,v 1.10 2000/06/01 16:27:56 rgbecker Exp $ '''
 __doc__='Test script for reportlab.tables'
 from reportlab.platypus import Spacer, SimpleDocTemplate, Table, TableStyle
 from reportlab.lib.units import inch
@@ -89,7 +92,7 @@
     return styles
 
 def run():
-    doc = SimpleDocTemplate('testtables.pdf', pageSize=(8.5*inch, 11*inch), showBoundary=1)
+    doc = SimpleDocTemplate('testtables.pdf', pagesize=(8.5*inch, 11*inch), showBoundary=1)
     styles = makeStyles()
     lst = []
     for style in styles:
--- a/utils/yaml/platprop.yml	Thu Jun 01 15:30:45 2000 +0000
+++ b/utils/yaml/platprop.yml	Thu Jun 01 16:28:35 2000 +0000
@@ -199,7 +199,7 @@
 
 The things which go into frames must conform to the "Flowable"
 interface.  This is defined as follows:
-.getClassDoc reportlab.platypus.layout Flowable
+.getClassDoc reportlab.platypus.flowables Flowable
 
 A conversation takes place between a Flowable object and a
 frame involving a number of steps.  First the packer calls
@@ -506,6 +506,9 @@
 .h1 Appendix A - CVS Revision History
 .beginPre Code
 $Log: platprop.yml,v $
+Revision 1.12  2000/06/01 16:28:35  rgbecker
+pageSize is wrong at present
+
 Revision 1.11  2000/05/24 14:06:34  andy_robinson
 Documentation tools working nicely
 
--- a/utils/yaml/yaml2pdf.py	Thu Jun 01 15:30:45 2000 +0000
+++ b/utils/yaml/yaml2pdf.py	Thu Jun 01 16:28:35 2000 +0000
@@ -19,6 +19,7 @@
 from reportlab.lib.styles import ParagraphStyle, StyleSheet1
 from reportlab.lib.enums import *
 from reportlab.lib.pagesizes import A4
+from reportlab.lib.units import inch
 from reportlab.platypus import *
 from reportlab.lib import colors
 
@@ -42,9 +43,8 @@
         canvas.drawCentredString(doc.pagesize[0] / 2, 0.75*inch, 'Page %d' % canvas.getPageNumber())
         canvas.restoreState()
 
-
 class MyDocTemplate(BaseDocTemplate):
-	_invalidInitArgs = ('pageTemplates',)
+    _invalidInitArgs = ('pageTemplates',)
     def __init__(self, filename, **kw):
         apply(BaseDocTemplate.__init__,(self,filename),kw)