[reportlab-users] Flowable too large (bug in doctemplate.py)
Robin Becker
reportlab-users@reportlab.com
Thu Nov 4 10:04:50 EST 2004
Denis S. Otkidach wrote:
......
>
> I've discovered that attribute _postponed is set to avoid infinite loops
> with comment "this ought to be cleared when they are finally drawn!",
> but it's realy is cleared only when the whole story is passed.
> Certainly, I can change the last line to "doc.build([Paragraph('test
> '*200, ParagraphStyle('normal')) for i in range(50)])" to work around
> this bug, but reusing of some flowable elements is quite common.
>
> I know I can wrap all reused flowables so that this attribute is set to
> unique wrapper instance and not shared flowable itself, but this would
> be annoying. Any other ideas how to quick-fix it?
>
You really ought not to be messing with the flowables this way. Each flowable is
supposed to be a separate instance. Teir internals are subject to arbitrary
manipulation by layout alorithms and the like. Python semantics make multiple
use of instances a risky business. If you have a large amount of state that you
wish to preserve then by all means wrap the hard bits with a thin flowable as
you suggest. You probably only need to implement wrapOn, drawOn, splitOn to
forward info to the underlying.
--
Robin Becker
More information about the reportlab-users
mailing list