[reportlab-users] Progress monitoring callbacks in Platypus
Andy Robinson
reportlab-users@reportlab.com
Tue, 9 Jul 2002 17:00:32 +0100
I've added some progress monitoring hooks to Platypus.
This was useful as I was generating manuals in a GUI
and wanted a smooth(ish) progress bar. Anyone else
wanting info on the progress of a long running job can
use this. Be warned, if you do multiple passes then
everything just gets called multiple times.
For any document template you can now do
docTemplate.setProgressCallBack(progressCB)
where progressCB is a two argument function.
Full explanation is in reportlab/platypus/doctemplate.py,
look for the 'progressCB' docstring.
In brief, a ten-flowable document with a callback
which prints the two arguments would generate
the following call sequence.
PROGRESS MONITOR: STARTED 0
PROGRESS MONITOR: SIZE_EST 10
PROGRESS MONITOR: PROGRESS 1
PROGRESS MONITOR: PROGRESS 2
PROGRESS MONITOR: PROGRESS 3
PROGRESS MONITOR: PROGRESS 4
PROGRESS MONITOR: PROGRESS 5
PROGRESS MONITOR: PROGRESS 6
PROGRESS MONITOR: PROGRESS 7
PROGRESS MONITOR: PROGRESS 8
PROGRESS MONITOR: PROGRESS 9
PROGRESS MONITOR: PROGRESS 10
PROGRESS MONITOR: FINISHED 0
Regards,
Andy Robinson