Python Script demo site
A few announcements. First, in the interests of sanity and getting things moving, I'm choosing the only name other than "Python Method" to get a positive score in the naming poll. I like it, Guido likes it, the community sort of likes it, so it's official. Zope 2.3 will introduce "Python Script" objects. There will be no "Unrestricted" vs. "Restricted". If you want to write unrestricted code, you can use a good old External Method, or write a small module and import it in a Script object. Finally, if you want to give Python Scripts a try, you can now play with them without any CVS, installation, or Zope version worries. Go to http://ps.4-am.com:9000/ , pick a password, and you'll get your own private area in a trunk CVS checkout of Zope in which to play. I plan to add example Scripts, but for now there's just the raw Zope management interface. When I add examples, I'll announce it here on the Zope list. Cheers, Evan @ digicool & 4-am
Evan Simpson wrote:
so it's official. Zope 2.3 will introduce "Python Script" objects.
Sounds good enough to me :-) When do DTML Methods become DTML Scripts? (never, hopefully ;-)
There will be no "Unrestricted" vs. "Restricted". If you want to write unrestricted code, you can use a good old External Method, or write a small module and import it in a Script object.
:-)
password, and you'll get your own private area in a trunk CVS checkout of Zope in which to play.
Is there going to be a python methdos help tab eventually? The bindings tab looks very cool, by the way :-)) Interested about the parameters box... If I specify parameters 'wibble, fish', and then do: <dtml-var "mypythonmethod('wibble',1)"> ...will wibble='wibble' and fish=1 in the method? Will the bound names still be bound to what they would have been, had I just done <dtml-var mypythonmethod> ? Likewise, if I do: <dtml-let wibble='wibble', fish="1"> <dtml-var mypthonmethod> </dtml-let> ...will it have the same effect? Finally, I'm not sure, from a user confusion point of view that allowing bound names to also appear in the parameter list is a good idea... Apart from that, looks very cool :-) cheers, Chris
From: "Chris Withers" <chrisw@nipltd.com>
Is there going to be a python methdos help tab eventually?
Help is on the way.
If I specify parameters 'wibble, fish', and then do:
<dtml-var "mypythonmethod('wibble',1)">
...will wibble='wibble' and fish=1 in the method?
Yep. Parameters work normally.
Will the bound names still be bound to what they would have been, had I just done <dtml-var mypythonmethod> ?
Likewise, if I do: <dtml-let wibble='wibble', fish="1"> <dtml-var mypthonmethod> </dtml-let>
This is tied up in whether you bind the "caller's namespace" in the Bindings tab. If you do, then calling by name, as above, will automatically look the parameters up in the namespace, so your example will work. If you don't bind the namespace (it isn't bound by default) you can only call by name if there are no parameters. Go to the demo site -- try it out!
Finally, I'm not sure, from a user confusion point of view that allowing bound names to also appear in the parameter list is a good idea...
They shouldn't, you're right. I'll take care of that soon. Cheers, Evan @ digicool
participants (3)
-
Chris Withers -
Evan Simpson -
Evan Simpson