[Zope3-checkins] CVS: Zope3/lib/python/Zope/Proxy - ContextWrapper.py:1.5.14.1
Jim Fulton
jim@zope.com
Sat, 30 Nov 2002 07:44:32 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Proxy
In directory cvs.zope.org:/tmp/cvs-serv30047/lib/python/Zope/Proxy
Modified Files:
Tag: Zope3-Bangalore-TTW-Branch
ContextWrapper.py
Log Message:
Refactored the way TTW component registration is done. There are now
separate registry objects that abstract the machinery for registering
multiple conflicting configurations and deciding which, if any are
active. Also provided a new field and widget for the status
information.
Along the way, cleaned up and streamlined placeful testing
infrastructure a bit.
Now checking into branch. Will give file-by-file (or at least more
specific logs) when the changes are merged into the head.
=== Zope3/lib/python/Zope/Proxy/ContextWrapper.py 1.5 => 1.5.14.1 ===
--- Zope3/lib/python/Zope/Proxy/ContextWrapper.py:1.5 Sat Jul 13 10:18:37 2002
+++ Zope3/lib/python/Zope/Proxy/ContextWrapper.py Sat Nov 30 07:44:32 2002
@@ -119,3 +119,17 @@
_ob = getinnercontext(_ob)
self._ob = _ob
return _ob
+
+def getItem(collection, name):
+ return ContextWrapper(collection[name], collection, name=name)
+
+def getAttr(collection, name):
+ return ContextWrapper(getattr(collection, name), collection, name=name)
+
+def queryItem(collection, name, default=None):
+ return ContextWrapper(collection.get(name, default),
+ collection, name=name)
+
+def queryAttr(collection, name, default=None):
+ return ContextWrapper(getattr(collection, name, default),
+ collection, name=name)