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

Dylan Reinhardt zope@dylanreinhardt.com
23 Apr 2003 08:35:52 -0700


Somehow what lines refers to is changing... that much seems clear.

Since lines appears to suvive intact until just before your loop, we can
assume that this is not a problem with passing lines *in* so much as
it's a problem with preserving the intended value of lines all the way
to the end of the code.

Longer term, you'll want to read up on debugging in Python.  For now,
let's just kludge something together.  Put this in the same file as your
external method code, just above run():

def lines_check(lines):
    type_info = 'lines is type: %s\n' % type(lines)
    return type_info + 'lines has value: %s' % lines

Now we start seeing what's what.  At any point in your code we can get a
quick snapshot of what's up with lines with:

return lines_check(lines)

Insert this expression at various points in your code, probably starting
with just after the definition and at the end of your loop.  Obviously,
you'll only be able to check one line at a time.  

Assuming they return different things, work inward to find the place
where lines changes and determine what it changes to.  

HTH,

Dylan