[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces - context.py:1.2
Jim Fulton
jim@zope.com
Mon, 2 Jun 2003 14:44:07 -0400
Update of /cvs-repository/Zope3/src/zope/app/interfaces
In directory cvs.zope.org:/tmp/cvs-serv19924
Modified Files:
context.py
Log Message:
Added IWrapper (for zope generic wrappers) and IZopeContextWrapper.
=== Zope3/src/zope/app/interfaces/context.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/interfaces/context.py:1.1 Sun Jun 1 13:22:10 2003
+++ Zope3/src/zope/app/interfaces/context.py Mon Jun 2 14:44:06 2003
@@ -17,6 +17,7 @@
"""
from zope.interface import Interface
+import zope.context.interfaces
class IContextWrapper(Interface):
"""Wrapper API provided to applications."""
@@ -34,3 +35,31 @@
Proxy(Wrapper(o1, parent, name='foo'), c1)
"""
+
+class IWrapper(zope.context.interfaces.IWrapper):
+ """Base Context wrapper
+
+ These objects extend context wrappers to:
+
+ - Prevent pickling
+
+ - To wrapper interface declarations.
+
+ """
+
+ def __reduce__():
+ """Raises pickle.PicklingError if called (to prevent pickling)"""
+
+ def __reduce_ex__(proto):
+ """Raises pickle.PicklingError if called (to prevent pickling)"""
+
+class IZopeContextWrapper(IWrapper):
+ """Context wrappers that provide Zope framework support.
+
+ This is a marker interface used to provide extra functionality,
+ generally context-dependent, to make using objects in Zope more
+ convenient.
+
+ Decorators registered to provide IZopeContextWrapper will usually
+ implement additional interfaces used by Zope.
+ """