[reportlab-users] PageBreak: wrong documentation within flowable.py
Massa, Harald Armin
chef at ghum.de
Mon Sep 3 04:20:27 EDT 2012
Hello,
I am working on a PageBreak that only breaks if it is not on the top
of a page (i.e., if by chance a natural PageBreak has just happened,
do not add an empty Page)
During analysis I read within flowable.py:
class UseUpSpace(NullDraw):
def __init__(self):
pass
def __repr__(self):
return "%s()" % self.__class__.__name__
def wrap(self, availWidth, availHeight):
self.width = availWidth
self.height = availHeight
return (availWidth,availHeight-1e-8) #step back a point
class PageBreak(UseUpSpace):
"""Move on to the next page in the document.
This works by consuming all remaining space in the frame!"""
and tried to learn about "availWidth" and stuff... only to learn that
this documentation is ... from some other time.
PageBreak in current reportlab is handled by the method
def handle_pageBreak(self,slow=None):
within the Doc-Template.
So I suggest to:
a) derive PageBreak just from flowable
b) update the docstring to
class PageBreak(Flowable):
"""Move on to the next page in the document.
this is done by the method handle_pageBreak within the
Doc-Template, which is triggered by
a flowable with this Class"""
Best wishes
Harald
--
GHUM GmbH
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
Amtsgericht Stuttgart, HRB 734971
More information about the reportlab-users
mailing list