[Zope] Utility functions
Andrew Athan
zope_list_replies@memeplex.com
Wed, 6 Nov 2002 23:03:18 -0500
What is the idiomatic way of expressing utility functions? I.e., python
scripts that are meant to be callable by a variety of templates, dtml
methods, other python scripts, etc. but which tend to be small, useful, and
usually oriented at manipulating data (not generating html).
Creating lots of separate Python (Script) objects seems like overkill, yet
defined functions inside such a script don't seem to be easily accessible
outside the script object.
E.g.
Script1
---------
def foo(a):
return a[0]
request= container.REQUEST
<blah blah>
return container.resultPage()
Script2
--------
<blah>
container.Script1.foo(x)
The call in Script2 doesn't work...I'll go read the source for a script
object and see if there's an attribute that gives me the access I'm looking
for, but I thought I'd ask the list, too.
aathan <Andrew Athan>