[Zope] Traversing subdirs in Python

oliver.erlewein@sqs.de oliver.erlewein@sqs.de
Thu, 20 Jun 2002 17:12:58 +0200 (MET DST)

Hi all

I have following script:

import string
id=string.split(file.filename, '\\')[-1]
context.manage_addProduct['OFSP'].manage_addFile(id, title="", file=file)
doc=getattr(context, id)
doc.manage_addProperty('comment', comment, 'string')

And the following Tree:

  +--- Hello1
  +--- Hello2

The script works but it puts the file into the directory the script is in (Hello1). How do I change the context to Hello2? The file has to be inserted there. I looked through the libs and tried some of the solutions but I can't find a thing. :-(

Any hints wellcome! Thanx