[TransWarp] peak and zope3

Ulrich Eck ueck at net-labs.de
Fri Jan 17 04:06:13 EST 2003

Hi Phillip,

> Anyway, the irony is that Interface is compatible, but won't work right if you have two versions in different
> namespaces.  Conversely, Persistence isn't the same, but will probably be able to work under two different namespaces.

with abit of sys.modules-patching i can now use the zope.interfaces package and all peak-tests pass.

Here is my "monkeypatch" that lives in a file called Interface.py in site-packages:
import sys

# fake the I* Modules
from zope.interface import interfaces as _interfaces
sys.modules['Interface.IInterface'] = _interfaces
sys.modules['Interface.IAttribute'] = _interfaces
sys.modules['Interface.IElement'] = _interfaces
sys.modules['Interface.IMethod'] = _interfaces

# fake the Attribute/Method Modules
from zope.interface import interface as _interface
sys.modules['Interface.Attribute'] = _interface
sys.modules['Interface.Method'] = _interface

# fake the other Modules
from zope.interface import exceptions as _exceptions
sys.modules['Interface.Exceptions'] = _exceptions
from zope.interface import implements as _implements
sys.modules['Interface.Implements'] = _implements
from zope.interface import verify as _verify
sys.modules['Interface.Verify'] = _verify

# Cleanup
del _interfaces
del _exceptions
del _implements
del _verify
del sys

# Interface is imported from _Interface.py
from zope.interface import Interface

there are about 20 occurences of Interface imports in the current peak package.
it would not be a big issue to modify it to use the current zope.interface
package. This would help to keep in sync as well.

would you accept a diff against the current cvs when i rewrite all stuff to
use zope.interface instead of Interface ??

Ulrich Eck
net-labs Systemhaus GmbH
Ebersberger Str. 46
85570 Markt Schwaben
fon:   +49-8121-4747-11
fax:   +49-8121-4747-77
email: ueck at net-labs.de

More information about the PEAK mailing list