Re: [Zope] Migration to Zope
Luciano Ramalho wrote:
Chris Withers wrote:
Sorry, but they are two completely seperate products, ask Evan ;-)
Can you tell me how they differ? I thought py-methods were just a previous manifestation of py-scripts.
Scripts are designed to replace Python Methods, but Scripts are not just a renamed version of Python Methods. IIUC, there are significant differences between them. Having never used python methods, I'm not in an ideal position to comment ;-)
Are there valid reasons for using py-methods instead of py-scripts today?
Apart from not having to rewrite legacy python methods, no, not really. cheers, Chris
--On Thursday, April 19, 2001 04:03:28 PM +0100 Chris Withers <chrisw@nipltd.com> wrote:
Luciano Ramalho wrote:
Chris Withers wrote:
Sorry, but they are two completely seperate products, ask Evan ;-)
Can you tell me how they differ? I thought py-methods were just a previous manifestation of py-scripts.
Access to other modules in py-methods was only via a hacked up '_' object sort of like the DTML _ namespace. E.G. _.string.split(...). Access to other modules in py-scripts is via import with security restrictions on what you can import. The default set of allowed modules is small, but it's pretty easy to extend. Py-methods could take a self argument that was passed implicitly. Exactly what it was is kind of vague. Py-scripts have an explicit Bindings tab that lets you specify the names for the various things you might want self to mean: acquisition context, container, the script itself, the DTML namespace, the traversal context. Py-methods had a test tab that was basically useless because there was no way to pass arguments to the method. Py-scripts have fixed this. Also, py-scripts have a well defined file system representation. Py-methods had one, but it was a good deal hackier.
participants (3)
-
Chris Withers -
Dan L. Pierson -
Simon Michael