[Zope-CMF] FSPythonScript outside CMF and outside skins tool

Dieter Maurer dieter@handshake.de
Fri, 6 Dec 2002 23:38:15 +0100


Itai Tavor writes:
 > I'm trying to use the FSPythonScript module from CMFCore to add a 
 > filesystem script to a folder. I'm not using the CMF or the Skins Tool.
 > 
 > I'm doing something like this:
 > 
 >          _prefix = package_home(globals())
 >          ob_id = 'test'
 >          fname = 'test'
 >          fp = path.join(_prefix, 'scripts', fname+'.py')
 >          ob = FSPythonScript(ob_id, fp)
 >          setattr(self, ob_id, ob)
 > 
 > And I get a 'cannot pickle code objects' error (traceback below) when I 
 > try to call the added object (which, BTW, contains only return 
 > 'hello'). Why? Can I fix this somehow?
"FSPythonScript" is not persistent and cannot be used outside
"Directory View".

It should not be difficult to implement a "PythonScriptFile"
on top of "PythonScript"
in analogy to "PageTemplateFile" on top of "PageTemplate".


Dieter