[Zope-dev] Re: Interfaces in Zope 2.5, 2.7, and 3.x

Tres Seaver tseaver at zope.com
Fri Mar 5 00:24:46 EST 2004


Martijn Faassen wrote:
> Jim Fulton wrote:
> 
>>> Martijn's suggestion was to use an alternate name for the 
>>> "__implements__" attribute.  I suppost I could do that -- call mine
>>>  "__narya_interfaces__", but that sounds ugly.  In particular, I
>>> don't really want my interfaces module to actually *conflict* with
>>> Zope's.
>>
>> As I mentioned on the zope3-dev list, you want to use the facade
>> Interface from (Packages3/Interface) in Zope 2.7. This is a bit of a
>> pain to set up. The facade will be a standard part of Zope 2.8.
> 
> As a note so Terry also sees; I couldn't get this to work.
> 
> Setting it up using the zope.conf 'path' setting in Zope 2.7 to include 
> this on the Python path fails, as Zope actually imports the old (non 
> facade) interface package before it gets to do configuration. This means 
> the facade never is imported, as the next imports will re-use the cached 
>   initial import.

Here is an excerpt from the 'runzope' I use for "FrankenZope" sites 
(that is our affectionate name for that Interface package):

   #!/bin/sh
   python="/opt/zc/bin/python2.3"
   zope_home="/opt/zc/lib/zope2.7"
   zodb3_home="/opt/zc/lib/zodb3.2"
   zope3_home="/opt/zc/lib/zope3"
   instance="/var/zc/appserver"
   transylvania="/opt/zc/lib/frankenzope"  # contains Interface!
   # N.B.:  $instance/lib/python contains a symlink to $transylvania

   PYTHONPATH="$instance/lib/python:$zodb3_home:$zope_home:zope3_home"
   export PYTHONPATH

   config_file="/opt/zc/etc/zope.conf"
   zope_run="$zope_home/Zope/Startup/run.py"

   exec "$python" "$zope_run" -C "$config_file" "$@"

Note that I abandoned earlier versions which just tried to force 
$transylvania into the head of $PYTHONPATH.  I don't recall now *why* 
that didn't work;  it could have been unrelated pilot error.  I can 
verify that with this setup, the shambling hulk *does* arise from the 
charging table.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com



More information about the Zope-Dev mailing list