Hello,

i added a new Template in pagetemplates.py by basically copypasting
TitlePage and modifying the __init__() and beforeDrawPage() functions.
In rlwriter.py at some point i call:

self.doc.addPageTemplate(MyNewTemplate)
elements.append(PageBreak())

This causes mw-render to go ballistic; for each chapter of the book an
error gets logged

2011-08-18T17:53:28 rlwriter.error >> article failed: "u'Warranty'"
2011-08-18T17:53:28 rlwriter.error >> Traceback (most recent call
last):
  File "/home/stefan/Projects/cg-mwlib.rl/lib/python2.7/site-packages/
mwlib.rl-0.12.8-py2.7.egg/mwlib/rl/rlwriter.py", line 405, in
articleRenderingOK
    testdoc.build(elements)
  File "/home/stefan/Projects/cg-mwlib.rl/lib/python2.7/site-packages/
mwlib.ext-0.12.3-py2.7-linux-i686.egg/mwlib/ext/reportlab/platypus/
doctemplate.py", line 796, in build
    self.handle_flowable(flowables)
  File "/home/stefan/Projects/cg-mwlib.rl/lib/python2.7/site-packages/
mwlib.ext-0.12.3-py2.7-linux-i686.egg/mwlib/ext/reportlab/platypus/
doctemplate.py", line 675, in handle_flowable
    f.apply(self)
  File "/home/stefan/Projects/cg-mwlib.rl/lib/python2.7/site-packages/
mwlib.ext-0.12.3-py2.7-linux-i686.egg/mwlib/ext/reportlab/platypus/
doctemplate.py", line 132, in apply
    getattr(doc,arn)(*args)
  File "/home/stefan/Projects/cg-mwlib.rl/lib/python2.7/site-packages/
mwlib.ext-0.12.3-py2.7-linux-i686.egg/mwlib/ext/reportlab/platypus/
doctemplate.py", line 550, in handle_nextPageTemplate
    raise ValueError, "can't find template('%s')"%pt
ValueError: can't find template('14.1 Warranty')
   handle_nextPageTemplate args=('14.1 Warranty',)

and there is no .pdf file created.

Leaving out the call to addPageTemplate works fine and yields no
errors.
According to e.g. this example for Reportlab:

http://code.activestate.com/recipes/123612-basedoctemplate-with-2-pagetemplate/

it appears that i also have to juggle around with calls to
nextPageTemplate(), the failure to do so seems consistent with the
Traceback above.

Could i get some information about how calls to addPageTemplate() and
nextPageTemplate() are handled in mwlib.rl?

Cheers,
 Stefan Birkholz

-- 
You received this message because you are subscribed to the Google Groups 
"mwlib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/mwlib?hl=en.

Reply via email to