I dug up an frxml from 2008. trying to load it into ReportDesigner.py throws:
(veyepar)carl@dc10:~/temp/dabo-trunk/ide$ python ReportDesigner.py
/home/carl/src/veyepar/dj/main/templates/release_agreement.rfxml
...
Exception RuntimeError: 'maximum recursion depth exceeded in
__subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
Traceback (most recent call last):
File "ReportDesigner.py", line 2725, in <module>
form.editor.openFile("%s" % fileSpec)
File "ReportDesigner.py", line 2055, in openFile
frameset_count = rdc.ReportForm.getFramesetCount()
File
"/home/carl/src/veyepar/lib/python2.6/site-packages/dabo/lib/reportWriter.py",
line 168, in __getattr__
raise AttributeError("Can't get attribute '%s'." % att)
AttributeError: Can't get attribute 'getFramesetCount'.
I can render it with the code below, but there is an expr error, and
some overlap. I would like to think that stuff didn't exist when I
made it 3 years ago.
#!/usr/bin/env python
# mailpdf.py
# generates custom release form pdf's
# so they can be e-mailed to speakers
from cStringIO import StringIO
from dabo.dReportWriter import dReportWriter
def mkpdf(ds):
"""
Return a pdf made from the passed dataset.
"""
rfxmlfile = 'release_agreement.rfxml'
# buffer to create pdf in
buffer = StringIO()
# generate the pdf in the buffer, using the layout and data
rw = dReportWriter(OutputFile=buffer,
ReportFormFile=rfxmlfile, Cursor=[ds])
rw.write()
# get the pdf out of the buffer
pdf = buffer.getvalue()
buffer.close()
return pdf
def test():
ds = {'talk_title':"Great PyCon 08 Talk",
'presenter_name':"John Doh",
'talk_id':"PM5", 'event_id':"113" }
pdf = mkpdf(ds)
open('test.pdf','wb').write(pdf)
return
if __name__=='__main__':
test()
--
Carl K
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/cadmzssgufapkcnnhq1ttl6pqwdtmwyg_gpgoi4rc+pfvmcc...@mail.gmail.com