[z3-checkins] r22035 - in
z3/Five/branch/rocky-products-less-product-loading: . doc
site site/tests tests
rocky at codespeak.net
rocky at codespeak.net
Thu Jan 12 15:50:00 CET 2006
Author: rocky
Date: Thu Jan 12 15:49:03 2006
New Revision: 22035
Modified:
z3/Five/branch/rocky-products-less-product-loading/ (props changed)
z3/Five/branch/rocky-products-less-product-loading/CHANGES.txt
z3/Five/branch/rocky-products-less-product-loading/doc/main.txt
z3/Five/branch/rocky-products-less-product-loading/site/localsite.py
z3/Five/branch/rocky-products-less-product-loading/site/tests/sitemanager.txt
z3/Five/branch/rocky-products-less-product-loading/tests/adapters.py
Log:
r6375 at zebrax (orig r21808): philikon | 2006-01-08 03:00:26 -031800
Merge r21806 from 1.3 branch (and add changes entry):
Fix http://codespeak.net/pipermail/z3-five/2006q1/001003.html. Sorry, this
was my bad.
r6377 at zebrax (orig r21821): philikon | 2006-01-08 12:24:36 -031800
Mention 1.3.1 bugfix release.
Modified: z3/Five/branch/rocky-products-less-product-loading/CHANGES.txt
==============================================================================
--- z3/Five/branch/rocky-products-less-product-loading/CHANGES.txt (original)
+++ z3/Five/branch/rocky-products-less-product-loading/CHANGES.txt Thu Jan 12 15:49:03 2006
@@ -17,6 +17,15 @@
NOTE: Anyone who copied the Five site.zcml to their
$INSTANCE_HOME/etc/ directory is going to need to update it.
+Five 1.3.1 (2006-01-08)
+=======================
+
+Bugfixes
+--------
+
+* Fix an adapter look-up bug in the local site implementation that was
+ due to an oversight during the port to Zope 3.2.
+
Five 1.3 (2006-01-07)
=====================
Modified: z3/Five/branch/rocky-products-less-product-loading/doc/main.txt
==============================================================================
--- z3/Five/branch/rocky-products-less-product-loading/doc/main.txt (original)
+++ z3/Five/branch/rocky-products-less-product-loading/doc/main.txt Thu Jan 12 15:49:03 2006
@@ -28,13 +28,16 @@
Download
--------
-We have released Five 1.2 and 1.3 on 7 January 2006. You may download
-Five 1.2 here:
+We have released Five 1.2 on 7 January 2006. You may download it
+here:
http://codespeak.net/z3/five/release/Five-1.2.tgz
-We aren't providing a tarball of Five 1.3 because it is included in
-Zope 2.9.
+We have released Five 1.3.1 on 8 January 2006. This is a bugfix
+release for Five 1.3 and will be included in the next Zope 2.9 bugfix
+release. You may download it here:
+
+http://codespeak.net/z3/five/release/Five-1.3.1.tgz
Joining the project
-------------------
Modified: z3/Five/branch/rocky-products-less-product-loading/site/localsite.py
==============================================================================
--- z3/Five/branch/rocky-products-less-product-loading/site/localsite.py (original)
+++ z3/Five/branch/rocky-products-less-product-loading/site/localsite.py Thu Jan 12 15:49:03 2006
@@ -111,7 +111,10 @@
@property
def adapters(self):
- return getGlobalSiteManager().adapters #XXX wrong
+ next = self.next
+ if next is None:
+ next = getGlobalSiteManager()
+ return next.adapters
@property
def utilities(self):
@@ -124,7 +127,10 @@
return self.adapters.queryMultiAdapter(objects, interface, name, default)
def getAdapters(self, objects, provided):
- return self.adapters.getAdapters(objects, provided)
+ next = self.next
+ if next is None:
+ next = getGlobalSiteManager()
+ return next.getAdapters(objects, provided)
def subscribers(self, required, provided):
return self.adapters.subscribers(required, provided)
Modified: z3/Five/branch/rocky-products-less-product-loading/site/tests/sitemanager.txt
==============================================================================
--- z3/Five/branch/rocky-products-less-product-loading/site/tests/sitemanager.txt (original)
+++ z3/Five/branch/rocky-products-less-product-loading/site/tests/sitemanager.txt Thu Jan 12 15:49:03 2006
@@ -85,9 +85,27 @@
True
The methods on registering and looking up utilities are covered by the
-utility tests in depth. The methods on adapter look up are indirectly
-covered in the functional test; view look up, for example, is adapter
-look up.
+utility tests in depth.
+
+We test some adapter look-up here. It is also indirectly covered in
+the functional test; view look up, for example, is adapter look up.
+
+First we provide an adapter:
+
+ >>> from Products.Five.tests.adapters import Adaptable, Adapter, IAdapted
+ >>> import zope.component
+ >>> zope.component.provideAdapter(Adapter)
+
+Now let's check for a simple adaption:
+
+ >>> adaptable = Adaptable()
+ >>> IAdapted(adaptable) #doctest: +ELLIPSIS
+ <Products.Five.tests.adapters.Adapter instance at ...>
+
+Let's get all the adapters for ``adaptable``:
+
+ >>> zapi.getAdapters((adaptable,), IAdapted) #doctest: +ELLIPSIS
+ [(u'', <Products.Five.tests.adapters.Adapter instance at ...>)]
Nesting sites
@@ -118,6 +136,10 @@
>>> getNextSiteManager(subsite.getSiteManager()).context == dummysite
True
+The adapters is registry is passed through to the global one:
+
+ >>> subsite.getSiteManager().adapters is zapi.getGlobalSiteManager().adapters
+ True
Finally, some clean up:
Modified: z3/Five/branch/rocky-products-less-product-loading/tests/adapters.py
==============================================================================
--- z3/Five/branch/rocky-products-less-product-loading/tests/adapters.py (original)
+++ z3/Five/branch/rocky-products-less-product-loading/tests/adapters.py Thu Jan 12 15:49:03 2006
@@ -16,6 +16,7 @@
$Id$
"""
from zope.interface import implements, Interface
+from zope.component import adapts
class IAdaptable(Interface):
"""This is a Zope 3 interface.
@@ -49,6 +50,7 @@
class Adapter:
implements(IAdapted)
+ adapts(IAdaptable)
def __init__(self, context):
self.context = context
More information about the z3-checkins
mailing list