Skip to content

Hebrew Institute

Sections
Personal tools
You are here: Home » MORPH Database » Web-based MORPH » HackathonWeblog
Views

HackathonWeblog

Document Actions
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 emdros directory 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.pt is a simple form + action. When the submit button is clicked, the file display.pt is the "ACTION" of the form. display.pt is 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.

« November 2008 »
Su Mo Tu We Th Fr Sa
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
 
 

Powered by Plone

This site conforms to the following standards: