[Zope] Using filesystem Python Scripts

Andy McKay andy@agmweb.ca
Fri, 24 Jan 2003 09:11:57 -0800


Oh sorry I read your email incorrectly I thought you were using a file 
system directory view from CMF. When you call processProperties from 
DTML you are calling a method of your product. For DTML or ZPT you use 
DTMLFile or PageTemplate to import your thing.

However with a Python Product, you dont need to make a Python Script 
object, you are already in Python. Why not just import it directly in 
Python? There isnt really a mechanism for doing as you suggest, it 
doesnt really make too much sense.

<tangent>Unless your object is folderish in which case you might want to 
manually add a Python Script to the ZODB in your product.</tangent>

Anyway you could make an __init__.py in scripts and then do ... then 
make a method of your object that uses it so

from scripts import processProperties

class whatever:

    somesecurity.declaration()
    def somefun(self...):
	processProperties(..)


You can then call somefun from DTML and you get properties function....

Hope that makes sense.
-- 
   Andy McKay