Views
HackathonWeblog
last edited 5 years ago by klowery
Tuesday, August 19, 2003
What We Learned Today
Today our goal was to do a "Proof of Concept": create a page template and an external python script, access an emdros database and display the results of a query for the text field of one verse.
- Zope 2.6.1 uses python 2.1.3, NOT 2.2 or 2.3. We had to modify the emdros compilation scripts. In the end, it would have been better to temporarily change the Debian /usr/bin/python link to python2.1.
- The python scripts must be external. That means all the emdros libraries must be place in /var/lib/zope/instance/default/Extensions. An alternative approach would be to create a Product, but we decided that is something that could be done later. Here is a listing of files in that directory:
-rw-rw-rw- 1 root root 587 Aug 19 11:04 EmdrosObject.py -rw-r--r-- 1 zope zope 1978 Aug 19 12:22 EmdrosObject.pyc -rw-rw-rw- 1 root root 50644 Aug 19 11:57 EmdrosPy.py -rw-r--r-- 1 zope zope 126295 Aug 19 12:22 EmdrosPy.pyc -rw-rw-rw- 1 root root 102079 Aug 19 11:57 EmdrosPy.pyo -rw-rw-rw- 1 root root 197 Aug 19 11:04 EmdrosWrapper.py -rw-r--r-- 1 zope zope 484 Aug 19 12:22 EmdrosWrapper.pyc -rwxr-xr-x 1 root root 931 Aug 19 11:57 _EmdrosPy.la -rwxr-xr-x 1 root root 242975 Aug 19 11:57 _EmdrosPy.so -rwxr-xr-x 1 root root 242975 Aug 19 11:57 _EmdrosPy.so.3 -rwxr-xr-x 1 root root 242975 Aug 19 11:57 _EmdrosPy.so.3.0.0 -rwxr-xr-x 1 root root 605199 Aug 19 11:57 libemdf.so -rwxr-xr-x 1 root root 605199 Aug 19 11:57 libemdf.so.3 -rwxr-xr-x 1 root root 605199 Aug 19 11:57 libemdf.so.3.0.0 -rwxr-xr-x 1 root root 899961 Aug 19 11:57 libmql.so -rwxr-xr-x 1 root root 899961 Aug 19 11:57 libmql.so.3 -rwxr-xr-x 1 root root 899961 Aug 19 11:57 libmql.so.3.0.0 -rwxr-xr-x 1 root root 48123 Aug 19 11:57 libpcre_emdros.so -rwxr-xr-x 1 root root 48123 Aug 19 11:57 libpcre_emdros.so.0 -rwxr-xr-x 1 root root 48123 Aug 19 11:57 libpcre_emdros.so.0.0.0
- An
emdrosdirectory was created in Zope right under root (later we'll want to use Plone Archetypes or something in a plone environment. Three files were created: two page templates and one python external method. submit.ptis a simple form + action. When the submit button is clicked, the filedisplay.ptis the "ACTION" of the form.display.ptis a simple template with the following TAL code in a span element:
<span tal:content="python:here.get_verse(request['book'], request['chapter'], request['verse'])">
The code calls an external method, which sits in the Extensions directory mentioned above.