[Zope] Newbie (again) using PIDDLE with Zope

Ashley Lloyd ashleylloyd@hotmail.com
Tue, 01 Apr 2003 09:55:33 +0100


Hi, I asked a question about this a few weeks ago, and didn't get very far, 
so I have a more specific question for anyone using PIDDLE with Zope (or 
anyone else with any ideas):

I am using Zope 2.5.1, Win 2000 (sorry), PIDDLE 1.0.15.

As you will soon learn I am quite new to Zope, and Python, and even OOP as a 
whole, so please bear with me!

I am hoping to use piddle to generate PDF documents on-the-fly, and the 
current train of thought is: in response to a user request, create a PDF 
document in a localfs instance, then open that document.

I am currently trying to just get testpdfgen.py to work from inside Zope, as 
an external method. (For those unfamiliar with piddle, this should just 
create a test pdf document, demonstrating that it works).
I have changed testpdfgen.py only very slightly - giving a (hopefully) valid 
filename in the localfs instance for file creation. testpdfgen is in the 
Extensions folder, and a few methods it requires (pdfgen, pdfutils, pdfdoc, 
pdfgeom, pdfmetrics) have been copied into my_Zope_Instance/bin/lib.

I have an external method in Zope, called testpdfgen, which is linked to the 
run function in testpdfgen.py.

I have a method that calls <dtml-call testpdfgen>, which results in the 
following error:
_______________________________________________________________________

Error Type: AttributeError

Error Value: 'pdfgen' module has no attribute 'Canvas'

Error Traceback (most recent call last):
File "C:\PROGRA~1\ZopeSite\lib\python\DocumentTemplate\DT_Try.py", line 149, 
in render_try_except result = render_blocks(self.section, md) File 
"C:\PROGRA~1\ZopeSite\lib\python\Products\ExternalMethod\ExternalMethod.py", 
line 198, in __call__ try: return apply(f,args,kw) File 
"C:\PROGRA~1\ZopeSite\Extensions\testpdfgen.py", line 127, in run c = 
pdfgen.Canvas('/TFEye/localfiles/testpdfgen.pdf') AttributeError: 'pdfgen' 
module has no attribute 'Canvas'
_______________________________________________________________________

Canvas is a class defined in pdfgen.

I know there will be a simple answer from those of you in the know, I'm just 
nowhere near in the know yet!

TIA

Ashley

_________________________________________________________________
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger