[reportlab-users] how does this work ?

Jerome Alet reportlab-users@reportlab.com
Tue, 13 May 2003 11:22:43 +0200


Hi,

I don't understand something or maybe there's a problem in platypus' 
doctemplate.py particularly in the BaseDocTemplate class. 

the build() and _startBuild() methods all accept a canvasmaker 
argument to (I suppose) allow people to use their own canvas class 
instead of the default one (pdfgen.canvas.Canvas) 

this argument's default value is canvas.Canvas, to use the default
canvas implementation of ReportLab if the user doesn't want to
use his own class.

BUT, the canvas module is never imported in doctemplate.py

How can this work ?

Does it work because in every program which actually use Platypus
the canvas.Canvas class was already imported somewhere else or
did I miss something ? (it is imported in para.py, flowables.py
and figures.py)

Is it a bug ?

Also shouldn't the SimpleDocTemplate class' build method accept a
canvasmaker argument too ?

bye,

Jerome Alet