[Zope] Newbie - passing a list to an External Method
Ashley Lloyd
ashleylloyd@hotmail.com
Wed, 23 Apr 2003 13:51:12 +0100
Chris,
thanks again for your help, although I'm not sure I know exactly what you
mean (my stupidity as opposed to anything else!).
There is very little to this External Method:
def run(self)
REQUEST = self.REQUEST
fileID = REQUEST.fileId
lines = REQUEST.lines
import sping.stringformat
from sping.PDF import PDFCanvas
from sping.PS import PSCanvas
filename="c:/zopepdf/"+fileID
canvas = PDFCanvas(size=(350,200), name=filename)
y = 20
# return lines works fine here
for line in lines: # this is the line where the error is reported.
# print line here also generates the same __getitem__ AttributeError
sping.stringformat.drawString(canvas, line, 10,y)
y = y + 20
canvas.flush()
canvas.save()
# If trying to print line I try returning printed here instead
return fileID
I don't know what other debugging I can do, so would be grateful for
suggestions. Again, if I define, or over-write the lines variable inside the
External Method, (ie lines=[], lines.append ...) then it works fine, its
just when it retrieves lines from request, or it is passed as a parameter.
Cheers
Ashley
_________________________________________________________________
Hotmail messages direct to your mobile phone http://www.msn.co.uk/mobile