Archive for June, 2006

install Zope 2.9.3 with Python 2.4.3 on Mac OS X

install python
download python tarball of python here.

untar and change to the directory in your terminal and run config:

./configure --prefix=/opt/python-2.4.3

run make to compile the stuff:

make

and then install it:

make install

install zope

download tarball here

./configure --with-python=/opt/python-2.4.3/bin/python --prefix=/opt/zope-2.9.3
make
make install

after that you are ready to create a zope instance:

/opt/zope-2.9.3/mkzopeinstance.py 

Flash 9 Beta for Intel Macs released

Adobe released a brand new beta version for flash plugin 9. you can find it here. My first impression is very good. The speed is arround twice as fast as the old flash player 8 plugin (which was a beta for intel macs too and which was really much slower on intel macs compared to ppc)

html form -> python primitives

Every once and a while i need to gather data in a html form and pass the results to a python script. The last time i needed it when working on a widget for the CoordinateField while working needed for the Loccata project.
This example is a nice cheatsheet on how to do define a form that collects the data needed by the following function:

def myFunction(simplelist, rec):
print 'List:', simplelist
print 'Rec:', rec

the form code somewhere in a pagetemplate looks like this

<form action="myFunction" tal:attributes="action string:${here/absolute_url}/myFunction">
<input type="hidden" name="simplelist:list" value="hi0">
<input type="hidden" name="simplelist:list" value="hi1">
<input type="hidden" name="simplelist:list" value="hi2">

<input type="hidden" name="rec.name:records" value="james">
<input type="hidden" name="rec.age:records" value="007">
<input type="hidden" name="rec.name:records" value="foo">
<input type="hidden" name="rec.age:records" value="4711">

<input class="context" type="submit" value="Call!"/>
</form>

if you submit the form, you’ll get the following result:

List: ['hi0', 'hi1', 'hi2']
Rec: [{'age': '007', 'name': 'james'}, {'age': '4711', 'name': 'foo'}]