diff -Nru zc.catalog-1.5/bootstrap.py zc.catalog-1.5.1/bootstrap.py --- zc.catalog-1.5/bootstrap.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/bootstrap.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################## # -# Copyright (c) 2006 Zope Corporation and Contributors. +# Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, diff -Nru zc.catalog-1.5/buildout.cfg zc.catalog-1.5.1/buildout.cfg --- zc.catalog-1.5/buildout.cfg 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/buildout.cfg 2012-01-20 19:20:40.000000000 +0000 @@ -1,13 +1,13 @@ [buildout] -extends = - http://download.zope.org/zopetoolkit/index/1.0c3/zopeapp-versions.cfg - http://download.zope.org/zopetoolkit/index/1.0c3/ztk-versions.cfg parts = test test_no_browser versions = versions develop = . +[versions] +zope.testing = 3.10.3 + [test] recipe = zc.recipe.testrunner eggs = zc.catalog [test, browser, test_browser] diff -Nru zc.catalog-1.5/CHANGES.txt zc.catalog-1.5.1/CHANGES.txt --- zc.catalog-1.5/CHANGES.txt 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/CHANGES.txt 2012-01-20 19:20:40.000000000 +0000 @@ -5,6 +5,18 @@ The 1.2 line (and higher) supports Zope 3.4/ZODB 3.8. The 1.1 line supports Zope 3.3/ZODB 3.7. +1.5.1 (2012-01-20) +------------------ + +- Fix the extent catalog's `searchResults` method to work when using a + local uid source. + +- Replaced a testing dependency on ``zope.app.authentication`` with + ``zope.password``. + +- Removed ``zope.app.server`` test dependency. + + 1.5 (2010-10-19) ---------------- diff -Nru zc.catalog-1.5/COPYRIGHT.txt zc.catalog-1.5.1/COPYRIGHT.txt --- zc.catalog-1.5/COPYRIGHT.txt 1970-01-01 00:00:00.000000000 +0000 +++ zc.catalog-1.5.1/COPYRIGHT.txt 2012-01-20 19:20:40.000000000 +0000 @@ -0,0 +1 @@ +Zope Foundation and Contributors \ No newline at end of file diff -Nru zc.catalog-1.5/debian/changelog zc.catalog-1.5.1/debian/changelog --- zc.catalog-1.5/debian/changelog 2011-12-31 08:17:00.000000000 +0000 +++ zc.catalog-1.5.1/debian/changelog 2012-01-24 15:33:53.000000000 +0000 @@ -1,3 +1,11 @@ +zc.catalog (1.5.1-0ubuntu1) precise; urgency=low + + * New upstream release. + * debian/copyright: update, convert to dep5 format. + * debian/pydist-overrides: remove, we use van.pydeb. + + -- Gediminas Paulauskas Fri, 20 Jan 2012 21:25:24 +0200 + zc.catalog (1.5-0ubuntu5) precise; urgency=low * Rebuild to drop python2.6 dependencies. diff -Nru zc.catalog-1.5/debian/control zc.catalog-1.5.1/debian/control --- zc.catalog-1.5/debian/control 2011-06-28 10:12:05.000000000 +0000 +++ zc.catalog-1.5.1/debian/control 2012-01-20 19:28:44.000000000 +0000 @@ -3,10 +3,13 @@ Priority: extra Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Gediminas Paulauskas -Build-Depends: debhelper (>= 7), python-all (>= 2.6.6-3~), - python-setuptools (>= 0.6b3), python-van.pydeb (>= 1.3.0-4) +Build-Depends: debhelper (>= 7), + python-all (>= 2.6.6-3~), + python-setuptools, + python-van.pydeb (>= 1.3.0-4) Standards-Version: 3.9.2 X-Python-Version: >= 2.5 +Homepage: http://pypi.python.org/pypi/zc.catalog Package: python-zc.catalog Architecture: all diff -Nru zc.catalog-1.5/debian/copyright zc.catalog-1.5.1/debian/copyright --- zc.catalog-1.5/debian/copyright 2011-06-28 10:12:05.000000000 +0000 +++ zc.catalog-1.5.1/debian/copyright 2012-01-20 19:36:06.000000000 +0000 @@ -1,74 +1,52 @@ -This package was debianized by Brian Sutherland - -It was downloaded from http://pypi.python.org/pypi/zc.catalog - -Copyright: - -Upstream Author: Zope Corporation and Contributors - -Files contain this header: - -# Copyright (c) 2004, 2006, 2007 Zope Corporation and Contributors. -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. - -Zope Public License (ZPL) Version 2.1 -------------------------------------- - -A copyright notice accompanies this license document that -identifies the copyright holders. - -This license has been certified as open source. It has also -been designated as GPL compatible by the Free Software -Foundation (FSF). - -Redistribution and use in source and binary forms, with or -without modification, are permitted provided that the -following conditions are met: - -1. Redistributions in source code must retain the - accompanying copyright notice, this list of conditions, - and the following disclaimer. - -2. Redistributions in binary form must reproduce the accompanying - copyright notice, this list of conditions, and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -3. Names of the copyright holders must not be used to - endorse or promote products derived from this software - without prior written permission from the copyright - holders. - -4. The right to distribute this software or to use it for - any purpose does not give you the right to use - Servicemarks (sm) or Trademarks (tm) of the copyright - holders. Use of them is covered by separate agreement - with the copyright holders. - -5. If any files are modified, you must cause the modified - files to carry prominent notices stating that you changed - the files and the date of any change. - -Disclaimer - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' - AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT - NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - NO EVENT SHALL THE COPYRIGHT HOLDERS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. +Format: http://dep.debian.net/deps/dep5/ +Upstream-Name: zc.catalog +Upstream-Contact: Zope Corporation and Contributors +Source: http://pypi.python.org/pypi/zc.catalog + +Files: * +Copyright: (c) 2004, 2006, 2007 Zope Foundation and Contributors. +License: Zope-2.1 + Zope Public License (ZPL) Version 2.1 + . + A copyright notice accompanies this license document that identifies the + copyright holders. + . + This license has been certified as open source. It has also been designated as + GPL compatible by the Free Software Foundation (FSF). + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + 1. Redistributions in source code must retain the accompanying copyright + notice, this list of conditions, and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the accompanying copyright + notice, this list of conditions, and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + 3. Names of the copyright holders must not be used to endorse or promote + products derived from this software without prior written permission from the + copyright holders. + . + 4. The right to distribute this software or to use it for any purpose does not + give you the right to use Servicemarks (sm) or Trademarks (tm) of the + copyright + holders. Use of them is covered by separate agreement with the copyright + holders. + . + 5. If any files are modified, you must cause the modified files to carry + prominent notices stating that you changed the files and the date of any + change. + . + Disclaimer + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru zc.catalog-1.5/debian/pydist-overrides zc.catalog-1.5.1/debian/pydist-overrides --- zc.catalog-1.5/debian/pydist-overrides 2011-06-28 10:12:05.000000000 +0000 +++ zc.catalog-1.5.1/debian/pydist-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -ZODB3 python-zodb -pytz python-tz -setuptools python-setuptools -zope.catalog python-zope.catalog -zope.component python-zope.component -zope.container python-zope.container -zope.i18nmessageid python-zope.i18nmessageid -zope.index>=3.5.1 python-zope.index>=3.5.1 -zope.interface python-zope.interface -zope.publisher python-zope.publisher -zope.schema python-zope.schema -zope.security python-zope.security diff -Nru zc.catalog-1.5/debian/tests/control zc.catalog-1.5.1/debian/tests/control --- zc.catalog-1.5/debian/tests/control 2011-06-28 10:12:05.000000000 +0000 +++ zc.catalog-1.5.1/debian/tests/control 2012-01-20 19:39:20.000000000 +0000 @@ -1,3 +1,3 @@ Tests: all Features: no-build-needed -Depends: @, python-zope.intid, python-zope.keyreference, python-zope.login, python-zope.securitypolicy, python-zope.testbrowser, python-zope.testing, zope.app.form, zope.browsermenu, zope.app.appsetup, zope.app.authentication, zope.app.catalog, zope.app.server, zope.app.testing, zope.app.zcmlfiles +Depends: @, python-zope.testrunner, python-zope.intid, python-zope.keyreference, python-zope.login, python-zope.password, python-zope.securitypolicy, python-zope.testbrowser, python-zope.testing, zope.app.form, zope.browsermenu, zope.app.appsetup, zope.app.catalog, zope.app.testing, zope.app.zcmlfiles diff -Nru zc.catalog-1.5/LICENSE.txt zc.catalog-1.5.1/LICENSE.txt --- zc.catalog-1.5/LICENSE.txt 1970-01-01 00:00:00.000000000 +0000 +++ zc.catalog-1.5.1/LICENSE.txt 2012-01-20 19:20:40.000000000 +0000 @@ -0,0 +1,44 @@ +Zope Public License (ZPL) Version 2.1 + +A copyright notice accompanies this license document that identifies the +copyright holders. + +This license has been certified as open source. It has also been designated as +GPL compatible by the Free Software Foundation (FSF). + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions in source code must retain the accompanying copyright +notice, this list of conditions, and the following disclaimer. + +2. Redistributions in binary form must reproduce the accompanying copyright +notice, this list of conditions, and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Names of the copyright holders must not be used to endorse or promote +products derived from this software without prior written permission from the +copyright holders. + +4. The right to distribute this software or to use it for any purpose does not +give you the right to use Servicemarks (sm) or Trademarks (tm) of the +copyright +holders. Use of them is covered by separate agreement with the copyright +holders. + +5. If any files are modified, you must cause the modified files to carry +prominent notices stating that you changed the files and the date of any +change. + +Disclaimer + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru zc.catalog-1.5/PKG-INFO zc.catalog-1.5.1/PKG-INFO --- zc.catalog-1.5/PKG-INFO 2010-10-19 07:46:38.000000000 +0000 +++ zc.catalog-1.5.1/PKG-INFO 2012-01-20 19:20:51.000000000 +0000 @@ -1,6 +1,6 @@ -Metadata-Version: 1.0 +Metadata-Version: 1.1 Name: zc.catalog -Version: 1.5 +Version: 1.5.1 Summary: Extensions to the Zope 3 Catalog Home-page: http://pypi.python.org/pypi/zc.catalog Author: Zope Corporation and Contributors @@ -21,6 +21,18 @@ The 1.2 line (and higher) supports Zope 3.4/ZODB 3.8. The 1.1 line supports Zope 3.3/ZODB 3.7. + 1.5.1 (2012-01-20) + ------------------ + + - Fix the extent catalog's `searchResults` method to work when using a + local uid source. + + - Replaced a testing dependency on ``zope.app.authentication`` with + ``zope.password``. + + - Removed ``zope.app.server`` test dependency. + + 1.5 (2010-10-19) ---------------- @@ -1101,6 +1113,8 @@ ... self.uids.insert(uid) ... def clear(self): ... self.uids.clear() + ... def apply(self, query): + ... return [uid for uid in self.uids if uid <= query] ... >>> class DummyContent(persistent.Persistent): ... def __init__(self, name, parent): @@ -1233,15 +1247,97 @@ We can pass our own instantiated UID utility to extentcatalog.Catalog. - >>> ext = extentcatalog.Extent(family=btrees_family) - >>> UIDSource = zope.intid.IntIds() - >>> cat = extentcatalog.Catalog(ext, UIDSource=UIDSource) - >>> cat.UIDSource is UIDSource + >>> extent = extentcatalog.Extent(family=btrees_family) + >>> uidutil = zope.intid.IntIds() + >>> cat = extentcatalog.Catalog(extent, uidutil) + >>> cat["index"] = DummyIndex() + >>> cat.UIDSource is uidutil + True + + >>> cat._getUIDSource() is uidutil True + + The ResultSet instance returned by the catalog's `searchResults` method + uses our UID utility. + >>> obj = DummyContent(43, root) - >>> cat.index_doc(UIDSource.register(obj), obj) - >>> cat.updateIndex(DummyIndex()) + >>> uid = uidutil.register(obj) + >>> cat.index_doc(uid, obj) + >>> res = cat.searchResults(index=uid) + >>> res.uidutil is uidutil + True + + >>> list(res) == [obj] + True + + `searchResults` may also return None. + + >>> cat.searchResults() is None + True + + Calling `updateIndex` and `updateIndexes` when the catalog has its uid source + set works as well. + + >>> cat.clear() + >>> uid in cat.extent + False + + All objects in the uid utility are indexed. + + >>> cat.updateIndexes() + >>> uid in cat.extent + True + + >>> len(cat.extent) + 1 + + >>> obj2 = DummyContent(44, root) + >>> uid2 = uidutil.register(obj2) + >>> cat.updateIndexes() + >>> len(cat.extent) + 2 + + >>> uid2 in cat.extent + True + + >>> uidutil.unregister(obj2) + + >>> cat.clear() + >>> uid in cat.extent + False + >>> cat.updateIndex(cat["index"]) + >>> uid in cat.extent + True + + With a self-populating extent, calling `updateIndex` or `updateIndexes` means + only the objects whose ids are in the extent are updated/reindexed; if present, + the catalog will use its uid source to look up the objects by id. + + >>> extent = extentcatalog.NonPopulatingExtent(family=btrees_family) + >>> cat = extentcatalog.Catalog(extent, uidutil) + >>> cat["index"] = DummyIndex() + + >>> extent.add(uid, obj) + >>> uid in cat["index"].uids + False + >>> cat.updateIndexes() + >>> uid in cat["index"].uids + True + + >>> cat.clear() + >>> uid in cat["index"].uids + False + + >>> uid in cat.extent + False + + >>> cat.extent.add(uid, obj) + >>> cat.updateIndex(cat["index"]) + >>> uid in cat["index"].uids + True + + [#cleanup]_ diff -Nru zc.catalog-1.5/setup.py zc.catalog-1.5.1/setup.py --- zc.catalog-1.5/setup.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/setup.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################## # -# Copyright (c) 2007 Zope Corporation and Contributors. +# Copyright (c) 2007 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, @@ -22,7 +22,7 @@ return open(os.path.join(os.path.dirname('.'), *rnames)).read() setup(name='zc.catalog', - version='1.5', + version='1.5.1', author='Zope Corporation and Contributors', author_email='zope-dev@zope.org', description="Extensions to the Zope 3 Catalog", @@ -69,20 +69,19 @@ test=[ 'zope.intid', 'zope.keyreference', - 'zope.login', - 'zope.securitypolicy', - 'zope.testbrowser', - 'zope.testing', + 'zope.testing < 4', ], browser=[ 'zope.app.form', 'zope.browsermenu', ], test_browser=[ + 'zope.login', + 'zope.password', + 'zope.securitypolicy', + 'zope.testbrowser', 'zope.app.appsetup', - 'zope.app.authentication', 'zope.app.catalog', - 'zope.app.server', 'zope.app.testing', 'zope.app.zcmlfiles', ]), diff -Nru zc.catalog-1.5/src/zc/catalog/browser/ftesting.zcml zc.catalog-1.5.1/src/zc/catalog/browser/ftesting.zcml --- zc.catalog-1.5/src/zc/catalog/browser/ftesting.zcml 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/browser/ftesting.zcml 2012-01-20 19:20:40.000000000 +0000 @@ -6,12 +6,11 @@ > - - + diff -Nru zc.catalog-1.5/src/zc/catalog/browser/tests.py zc.catalog-1.5.1/src/zc/catalog/browser/tests.py --- zc.catalog-1.5/src/zc/catalog/browser/tests.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/browser/tests.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################## # -# Copyright (c) 2004 Zope Corporation and Contributors. +# Copyright (c) 2004 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, @@ -13,7 +13,7 @@ ############################################################################## """Functional tests for `zc.catalog.browser`. -$Id: tests.py 117624 2010-10-18 08:52:55Z janwijbrand $ +$Id: tests.py 120585 2011-02-28 07:49:56Z icemac $ """ import doctest import os.path diff -Nru zc.catalog-1.5/src/zc/catalog/catalogindex.py zc.catalog-1.5.1/src/zc/catalog/catalogindex.py --- zc.catalog-1.5/src/zc/catalog/catalogindex.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/catalogindex.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################# # -# Copyright (c) 2006 Zope Corporation and Contributors. +# Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, diff -Nru zc.catalog-1.5/src/zc/catalog/extentcatalog.py zc.catalog-1.5.1/src/zc/catalog/extentcatalog.py --- zc.catalog-1.5/src/zc/catalog/extentcatalog.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/extentcatalog.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################# # -# Copyright (c) 2006 Zope Corporation and Contributors. +# Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, @@ -187,6 +187,12 @@ super(Catalog, self).unindex_doc(docid) self.extent.remove(docid) + def searchResults(self, **kwargs): + res = super(Catalog, self).searchResults(**kwargs) + if res is not None: + res.uidutil = self._getUIDSource() + return res + def updateIndex(self, index): if index.__parent__ is not self: # not an index in us. Let the superclass handle it. diff -Nru zc.catalog-1.5/src/zc/catalog/extentcatalog.txt zc.catalog-1.5.1/src/zc/catalog/extentcatalog.txt --- zc.catalog-1.5/src/zc/catalog/extentcatalog.txt 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/extentcatalog.txt 2012-01-20 19:20:40.000000000 +0000 @@ -38,6 +38,8 @@ ... self.uids.insert(uid) ... def clear(self): ... self.uids.clear() + ... def apply(self, query): + ... return [uid for uid in self.uids if uid <= query] ... >>> class DummyContent(persistent.Persistent): ... def __init__(self, name, parent): @@ -170,15 +172,97 @@ We can pass our own instantiated UID utility to extentcatalog.Catalog. - >>> ext = extentcatalog.Extent(family=btrees_family) - >>> UIDSource = zope.intid.IntIds() - >>> cat = extentcatalog.Catalog(ext, UIDSource=UIDSource) - >>> cat.UIDSource is UIDSource + >>> extent = extentcatalog.Extent(family=btrees_family) + >>> uidutil = zope.intid.IntIds() + >>> cat = extentcatalog.Catalog(extent, uidutil) + >>> cat["index"] = DummyIndex() + >>> cat.UIDSource is uidutil + True + + >>> cat._getUIDSource() is uidutil True + +The ResultSet instance returned by the catalog's `searchResults` method +uses our UID utility. + >>> obj = DummyContent(43, root) - >>> cat.index_doc(UIDSource.register(obj), obj) - >>> cat.updateIndex(DummyIndex()) + >>> uid = uidutil.register(obj) + >>> cat.index_doc(uid, obj) + >>> res = cat.searchResults(index=uid) + >>> res.uidutil is uidutil + True + + >>> list(res) == [obj] + True + +`searchResults` may also return None. + + >>> cat.searchResults() is None + True + +Calling `updateIndex` and `updateIndexes` when the catalog has its uid source +set works as well. + + >>> cat.clear() + >>> uid in cat.extent + False + +All objects in the uid utility are indexed. + >>> cat.updateIndexes() + >>> uid in cat.extent + True + + >>> len(cat.extent) + 1 + + >>> obj2 = DummyContent(44, root) + >>> uid2 = uidutil.register(obj2) + >>> cat.updateIndexes() + >>> len(cat.extent) + 2 + + >>> uid2 in cat.extent + True + + >>> uidutil.unregister(obj2) + + >>> cat.clear() + >>> uid in cat.extent + False + >>> cat.updateIndex(cat["index"]) + >>> uid in cat.extent + True + +With a self-populating extent, calling `updateIndex` or `updateIndexes` means +only the objects whose ids are in the extent are updated/reindexed; if present, +the catalog will use its uid source to look up the objects by id. + + >>> extent = extentcatalog.NonPopulatingExtent(family=btrees_family) + >>> cat = extentcatalog.Catalog(extent, uidutil) + >>> cat["index"] = DummyIndex() + + >>> extent.add(uid, obj) + >>> uid in cat["index"].uids + False + + >>> cat.updateIndexes() + >>> uid in cat["index"].uids + True + + >>> cat.clear() + >>> uid in cat["index"].uids + False + + >>> uid in cat.extent + False + + >>> cat.extent.add(uid, obj) + >>> cat.updateIndex(cat["index"]) + >>> uid in cat["index"].uids + True + + [#cleanup]_ diff -Nru zc.catalog-1.5/src/zc/catalog/globber.py zc.catalog-1.5.1/src/zc/catalog/globber.py --- zc.catalog-1.5/src/zc/catalog/globber.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/globber.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################# # -# Copyright (c) 2006 Zope Corporation and Contributors. +# Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, diff -Nru zc.catalog-1.5/src/zc/catalog/i18n.py zc.catalog-1.5.1/src/zc/catalog/i18n.py --- zc.catalog-1.5/src/zc/catalog/i18n.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/i18n.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################# # -# Copyright (c) 2006 Zope Corporation and Contributors. +# Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, diff -Nru zc.catalog-1.5/src/zc/catalog/index.py zc.catalog-1.5.1/src/zc/catalog/index.py --- zc.catalog-1.5/src/zc/catalog/index.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/index.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################# # -# Copyright (c) 2006 Zope Corporation and Contributors. +# Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, diff -Nru zc.catalog-1.5/src/zc/catalog/__init__.py zc.catalog-1.5.1/src/zc/catalog/__init__.py --- zc.catalog-1.5/src/zc/catalog/__init__.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/__init__.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################# # -# Copyright (c) 2007 Zope Corporation and Contributors. +# Copyright (c) 2007 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, diff -Nru zc.catalog-1.5/src/zc/catalog/interfaces.py zc.catalog-1.5.1/src/zc/catalog/interfaces.py --- zc.catalog-1.5/src/zc/catalog/interfaces.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/interfaces.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################# # -# Copyright (c) 2006 Zope Corporation and Contributors. +# Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, diff -Nru zc.catalog-1.5/src/zc/catalog/stemmer.py zc.catalog-1.5.1/src/zc/catalog/stemmer.py --- zc.catalog-1.5/src/zc/catalog/stemmer.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/stemmer.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################# # -# Copyright (c) 2006 Zope Corporation and Contributors. +# Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, diff -Nru zc.catalog-1.5/src/zc/catalog/tests.py zc.catalog-1.5.1/src/zc/catalog/tests.py --- zc.catalog-1.5/src/zc/catalog/tests.py 2010-10-19 07:46:28.000000000 +0000 +++ zc.catalog-1.5.1/src/zc/catalog/tests.py 2012-01-20 19:20:40.000000000 +0000 @@ -1,6 +1,6 @@ ############################################################################# # -# Copyright (c) 2006 Zope Corporation and Contributors. +# Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, diff -Nru zc.catalog-1.5/src/zc.catalog.egg-info/PKG-INFO zc.catalog-1.5.1/src/zc.catalog.egg-info/PKG-INFO --- zc.catalog-1.5/src/zc.catalog.egg-info/PKG-INFO 2010-10-19 07:46:32.000000000 +0000 +++ zc.catalog-1.5.1/src/zc.catalog.egg-info/PKG-INFO 2012-01-20 19:20:43.000000000 +0000 @@ -1,6 +1,6 @@ -Metadata-Version: 1.0 +Metadata-Version: 1.1 Name: zc.catalog -Version: 1.5 +Version: 1.5.1 Summary: Extensions to the Zope 3 Catalog Home-page: http://pypi.python.org/pypi/zc.catalog Author: Zope Corporation and Contributors @@ -21,6 +21,18 @@ The 1.2 line (and higher) supports Zope 3.4/ZODB 3.8. The 1.1 line supports Zope 3.3/ZODB 3.7. + 1.5.1 (2012-01-20) + ------------------ + + - Fix the extent catalog's `searchResults` method to work when using a + local uid source. + + - Replaced a testing dependency on ``zope.app.authentication`` with + ``zope.password``. + + - Removed ``zope.app.server`` test dependency. + + 1.5 (2010-10-19) ---------------- @@ -1101,6 +1113,8 @@ ... self.uids.insert(uid) ... def clear(self): ... self.uids.clear() + ... def apply(self, query): + ... return [uid for uid in self.uids if uid <= query] ... >>> class DummyContent(persistent.Persistent): ... def __init__(self, name, parent): @@ -1233,15 +1247,97 @@ We can pass our own instantiated UID utility to extentcatalog.Catalog. - >>> ext = extentcatalog.Extent(family=btrees_family) - >>> UIDSource = zope.intid.IntIds() - >>> cat = extentcatalog.Catalog(ext, UIDSource=UIDSource) - >>> cat.UIDSource is UIDSource + >>> extent = extentcatalog.Extent(family=btrees_family) + >>> uidutil = zope.intid.IntIds() + >>> cat = extentcatalog.Catalog(extent, uidutil) + >>> cat["index"] = DummyIndex() + >>> cat.UIDSource is uidutil + True + + >>> cat._getUIDSource() is uidutil True + + The ResultSet instance returned by the catalog's `searchResults` method + uses our UID utility. + >>> obj = DummyContent(43, root) - >>> cat.index_doc(UIDSource.register(obj), obj) - >>> cat.updateIndex(DummyIndex()) + >>> uid = uidutil.register(obj) + >>> cat.index_doc(uid, obj) + >>> res = cat.searchResults(index=uid) + >>> res.uidutil is uidutil + True + + >>> list(res) == [obj] + True + + `searchResults` may also return None. + + >>> cat.searchResults() is None + True + + Calling `updateIndex` and `updateIndexes` when the catalog has its uid source + set works as well. + + >>> cat.clear() + >>> uid in cat.extent + False + + All objects in the uid utility are indexed. + + >>> cat.updateIndexes() + >>> uid in cat.extent + True + + >>> len(cat.extent) + 1 + + >>> obj2 = DummyContent(44, root) + >>> uid2 = uidutil.register(obj2) + >>> cat.updateIndexes() + >>> len(cat.extent) + 2 + + >>> uid2 in cat.extent + True + + >>> uidutil.unregister(obj2) + + >>> cat.clear() + >>> uid in cat.extent + False + >>> cat.updateIndex(cat["index"]) + >>> uid in cat.extent + True + + With a self-populating extent, calling `updateIndex` or `updateIndexes` means + only the objects whose ids are in the extent are updated/reindexed; if present, + the catalog will use its uid source to look up the objects by id. + + >>> extent = extentcatalog.NonPopulatingExtent(family=btrees_family) + >>> cat = extentcatalog.Catalog(extent, uidutil) + >>> cat["index"] = DummyIndex() + + >>> extent.add(uid, obj) + >>> uid in cat["index"].uids + False + >>> cat.updateIndexes() + >>> uid in cat["index"].uids + True + + >>> cat.clear() + >>> uid in cat["index"].uids + False + + >>> uid in cat.extent + False + + >>> cat.extent.add(uid, obj) + >>> cat.updateIndex(cat["index"]) + >>> uid in cat["index"].uids + True + + [#cleanup]_ diff -Nru zc.catalog-1.5/src/zc.catalog.egg-info/requires.txt zc.catalog-1.5.1/src/zc.catalog.egg-info/requires.txt --- zc.catalog-1.5/src/zc.catalog.egg-info/requires.txt 2010-10-19 07:46:32.000000000 +0000 +++ zc.catalog-1.5.1/src/zc.catalog.egg-info/requires.txt 2012-01-20 19:20:43.000000000 +0000 @@ -14,16 +14,15 @@ [test] zope.intid zope.keyreference +zope.testing < 4 + +[test_browser] zope.login +zope.password zope.securitypolicy zope.testbrowser -zope.testing - -[test_browser] zope.app.appsetup -zope.app.authentication zope.app.catalog -zope.app.server zope.app.testing zope.app.zcmlfiles diff -Nru zc.catalog-1.5/src/zc.catalog.egg-info/SOURCES.txt zc.catalog-1.5.1/src/zc.catalog.egg-info/SOURCES.txt --- zc.catalog-1.5/src/zc.catalog.egg-info/SOURCES.txt 2010-10-19 07:46:32.000000000 +0000 +++ zc.catalog-1.5.1/src/zc.catalog.egg-info/SOURCES.txt 2012-01-20 19:20:43.000000000 +0000 @@ -1,4 +1,6 @@ CHANGES.txt +COPYRIGHT.txt +LICENSE.txt README.txt ZopePublicLicense.txt bootstrap.py