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

Itai Tavor itai@iinet.net.au
Sat, 7 Dec 2002 17:35:57 +1100


Well, that explains it :)

Thanks Dieter. I'll look at PageTemplateFile, I don't quite understand 
how FS objects work but like you say it probably won't be too hard to 
make a PythonScriptFile.

Thanks again.
Itai


On Saturday, December 7, 2002, at 09:38 AM, Dieter Maurer wrote:

> 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
>