[Zope] Re: Recursive Python Call in Zope

Christopher Baumbach chrizmo_zopeList@gmx.de
Tue, 19 Nov 2002 13:49:43 +0100 (MET)


> 
> Can you post your script, so we can see what's wrong with it?
> 

OK, here's my Script:

------------------------
#Args: obj=None, indent=0 (for the view)

from Products.PythonScripts.standard import html_quote
request = context.REQUEST
RESPONSE =  request.RESPONSE

if obj is None:
    obj=context

folders = obj.objectValues('Folder')

if len(folders) > 0:
   for i in range(len(folders)):
      folder = folders[i]
      ind = " " * indent
       subfolders = folder.objectValues('Folder')
       print ind + folder.id
       if len(subfolders) > 0:
         script(subfolders[i], indent+1)

return printed
------------------------

...it's not very complex - maybe I have to do more Python-practice ;-)

thanks for help,

C.


-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!