[Zope] Newbie - passing a list to an External Method

Ashley Lloyd ashleylloyd@hotmail.com
Tue, 22 Apr 2003 10:37:06 +0100


Just thought I should add this bit in, sorry:

If I assign to the lines variable inside the external method, using the same 
code that is in the python script, ie:

********************************************************************
#!/usr/bin/env python
def run(fileID, 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)
   lines=[]
   lines.append("Hello, this is my test pdf")
   lines.append("This is still my test pdf.")
   lines.append("Still here")
   lines.append("and this is the end ..")
   y = 20
   for line in lines:
       sping.stringformat.drawString(canvas, line, 10,y)
       y = y + 20

   canvas.flush()
   canvas.save()
   return fileID
********************************************************************

then this works fine. (The lines variable is still passed to the External 
Method, by the way, it just gets over-written)

Thanks again,

Ashley


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