[Checkins] SVN: zope.catalog/ Move zope.app.catalog core functionality to the zope.catalog.
Dan Korostelev
nadako at gmail.com
Sun Feb 1 10:55:13 EST 2009
Log message for revision 95860:
Move zope.app.catalog core functionality to the zope.catalog.
Changed:
A zope.catalog/
A zope.catalog/trunk/
U zope.catalog/trunk/CHANGES.txt
U zope.catalog/trunk/buildout.cfg
U zope.catalog/trunk/setup.py
_U zope.catalog/trunk/src/
D zope.catalog/trunk/src/zope/app/
A zope.catalog/trunk/src/zope/catalog/
D zope.catalog/trunk/src/zope/catalog/DEPENDENCIES.cfg
U zope.catalog/trunk/src/zope/catalog/README.txt
D zope.catalog/trunk/src/zope/catalog/SETUP.cfg
U zope.catalog/trunk/src/zope/catalog/apidoc.zcml
U zope.catalog/trunk/src/zope/catalog/attribute.py
D zope.catalog/trunk/src/zope/catalog/browser/
U zope.catalog/trunk/src/zope/catalog/catalog.py
U zope.catalog/trunk/src/zope/catalog/classes.zcml
U zope.catalog/trunk/src/zope/catalog/configure.zcml
U zope.catalog/trunk/src/zope/catalog/event.txt
U zope.catalog/trunk/src/zope/catalog/field.py
D zope.catalog/trunk/src/zope/catalog/ftesting.zcml
U zope.catalog/trunk/src/zope/catalog/interfaces.py
U zope.catalog/trunk/src/zope/catalog/keyword.py
U zope.catalog/trunk/src/zope/catalog/subscribers.zcml
D zope.catalog/trunk/src/zope/catalog/testing.py
U zope.catalog/trunk/src/zope/catalog/tests.py
U zope.catalog/trunk/src/zope/catalog/text.py
D zope.catalog/trunk/src/zope/catalog/zope.app.catalog-configure.zcml
-=-
Modified: zope.catalog/trunk/CHANGES.txt
===================================================================
--- zope.app.catalog/trunk/CHANGES.txt 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/CHANGES.txt 2009-02-01 15:55:13 UTC (rev 95860)
@@ -2,74 +2,9 @@
CHANGES
=======
-3.7.1 (unreleased)
+3.8.0 (unreleased)
------------------
-- ...
-
-3.7.0 (2009-01-31)
-------------------
-
-- Change catalog's addMenuItem permission to zope.ManageServices
- as it doesn't make any sense to add an empty catalog that you
- can't modify with zope.ManageContent permission and it's completely
- useless without indexes. So there's no need to show a menu item.
-
-- Replaced dependency on `zope.app.container` with a lighter-weight
- dependency upon the newly refactored `zope.container` package.
-
-3.6.0 (2009-01-03)
-------------------
-
-- Make TextIndex addform use default values as specified in
- zope.app.catalog.text.ITextIndex interface. Also, change
- "searchableText" to "getSearchableText" there, as it's the
- right value.
-
-- Add Keyword (case-insensitive and case-sensitive) catalog
- indices. It's now possible to use them, because ones in
- zope.index now implement IIndexSearch interface.
-
-- Add support for sorting, reversing and limiting result set
- in the ``searchResults`` method, using new IIndexSort interface
- features of zope.index.
-
-3.5.2 (2008-12-28)
-------------------
-
-- Remove testing dependencies from install_requires.
-
-3.5.1 (2007-10-31)
-------------------
-
-- Resolve ``ZopeSecurityPolicy`` deprecation warning.
-
-
-3.5.0 (2007-10-11)
-------------------
-
-- Updated some meta-data.
-
-- Move ``ftests.py`` to ``tests.py``.
-
-
-3.5.0a3 (2007-09-27)
---------------------
-
-- removed some deprecations
-
-
-3.5.0a2 (2007-09-21)
---------------------
-
-- bugfix: passing the context to getAllUtilitiesRegisteredFor in all
- eventhandlers because no catalog was found which was located in a
- sub site and for example the ObjectModifiesEvent get fired from somewhere
- in the root.
-
-
-3.5.0a1 (2007-06-26)
---------------------
-
-- Added marker interfaces to prevent automatic indexing (see: ``event.txt``)
-
+- Move core functionality from ``zope.app.catalog`` to this package.
+ The ``zope.app.catalog`` package now only contains ZMI-related browser
+ views and backward-compatibility imports.
Modified: zope.catalog/trunk/buildout.cfg
===================================================================
--- zope.app.catalog/trunk/buildout.cfg 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/buildout.cfg 2009-02-01 15:55:13 UTC (rev 95860)
@@ -1,7 +1,7 @@
[buildout]
-develop = . zope.container zope.app.container
+develop = .
parts = test
[test]
recipe = zc.recipe.testrunner
-eggs = zope.app.catalog [test]
+eggs = zope.catalog [test]
Modified: zope.catalog/trunk/setup.py
===================================================================
--- zope.app.catalog/trunk/setup.py 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/setup.py 2009-02-01 15:55:13 UTC (rev 95860)
@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Setup for zope.app.catalog package
+"""Setup for zope.catalog package
$Id$
"""
@@ -21,20 +21,20 @@
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-setup(name = 'zope.app.catalog',
- version = '3.7.1dev',
+setup(name = 'zope.catalog',
+ version = '3.8.0dev',
author='Zope Corporation and Contributors',
author_email='zope-dev at zope.org',
- description='Zope Cataloging and Indexing Framework',
+ description='Cataloging and Indexing Framework for Zope 3',
long_description=(
read('README.txt')
+ '\n\n' +
'Detailed Documentation\n'
'**********************\n'
+ '\n\n' +
- read('src', 'zope', 'app', 'catalog', 'README.txt')
+ read('src', 'zope', 'catalog', 'README.txt')
+ '\n\n' +
- read('src', 'zope', 'app', 'catalog', 'event.txt')
+ read('src', 'zope', 'catalog', 'event.txt')
+ '\n\n' +
read('CHANGES.txt')
),
@@ -49,24 +49,20 @@
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Framework :: Zope3'],
- url='http://pypi.python.org/pypi/zope.app.catalog',
+ url='http://pypi.python.org/pypi/zope.catalog',
license='ZPL 2.1',
packages=find_packages('src'),
package_dir = {'': 'src'},
- namespace_packages=['zope', 'zope.app'],
+ namespace_packages=['zope'],
extras_require = dict(
test=['zope.testing',
- 'zope.app.component',
'zope.app.testing',
- 'zope.app.securitypolicy',
- 'zope.app.zcmlfiles',
- 'zope.app.zptpage',
]),
install_requires = [
'setuptools',
'ZODB3',
'zope.annotation',
- 'zope.app.intid',
+ 'zope.intid',
'zope.component',
'zope.container',
'zope.index>=3.5.0',
@@ -74,7 +70,6 @@
'zope.lifecycleevent',
'zope.location',
'zope.schema',
- 'zope.traversing',
],
include_package_data = True,
zip_safe = False,
Property changes on: zope.catalog/trunk/src
___________________________________________________________________
Modified: svn:ignore
- zope.app.catalog.egg-info
+ zope.app.catalog.egg-info
zope.catalog.egg-info
Deleted: zope.catalog/trunk/src/zope/catalog/DEPENDENCIES.cfg
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/DEPENDENCIES.cfg 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/DEPENDENCIES.cfg 2009-02-01 15:55:13 UTC (rev 95860)
@@ -1,7 +0,0 @@
-zope.app.intid
-zope.index
-BTrees
-ZODB
-persistent
-transaction
-zope.interface
Modified: zope.catalog/trunk/src/zope/catalog/README.txt
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/README.txt 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/README.txt 2009-02-01 15:55:13 UTC (rev 95860)
@@ -4,7 +4,7 @@
Catalogs provide management of collections of related indexes with a
basic search algorithm. Let's look at an example:
- >>> from zope.app.catalog.catalog import Catalog
+ >>> from zope.catalog.catalog import Catalog
>>> cat = Catalog()
We can add catalog indexes to catalogs. A catalog index is, among
@@ -68,15 +68,15 @@
Now, we can use the AttributeIndex mixin to make this an attribute
index:
- >>> import zope.app.catalog.attribute
+ >>> import zope.catalog.attribute
+ >>> import zope.catalog.interfaces
>>> import zope.container.contained
- >>> import zope.app.catalog.interfaces
- >>> class Index(zope.app.catalog.attribute.AttributeIndex,
+ >>> class Index(zope.catalog.attribute.AttributeIndex,
... BaseIndex,
... zope.container.contained.Contained,
... ):
- ... zope.interface.implements(zope.app.catalog.interfaces.ICatalogIndex)
+ ... zope.interface.implements(zope.catalog.interfaces.ICatalogIndex)
Unfortunately, because of the way we currently handle containment
constraints, we have to provide `ICatalogIndex`, which extends
@@ -191,9 +191,9 @@
maintaining id <-> object mappings. To see how this works, we'll
create a utility to work with our catalog:
- >>> import zope.app.intid.interfaces
+ >>> import zope.intid.interfaces
>>> class Ids:
- ... zope.interface.implements(zope.app.intid.interfaces.IIntIds)
+ ... zope.interface.implements(zope.intid.interfaces.IIntIds)
... def __init__(self, data):
... self.data = data
... def getObject(self, id):
@@ -202,8 +202,8 @@
... return self.data.iterkeys()
>>> ids = Ids({1: o1, 2: o2, 3: o3, 4: o4, 5: o5, 6: o6})
- >>> from zope.app.testing import ztapi
- >>> ztapi.provideUtility(zope.app.intid.interfaces.IIntIds, ids)
+ >>> from zope.component import provideUtility
+ >>> provideUtility(ids, zope.intid.interfaces.IIntIds)
With this utility in place, catalogs can recompute indexes:
@@ -328,11 +328,11 @@
... _, result = BTrees.IFBTree.weightedUnion(result, set)
... return result
- >>> class KeywordIndex(zope.app.catalog.attribute.AttributeIndex,
+ >>> class KeywordIndex(zope.catalog.attribute.AttributeIndex,
... BaseKeywordIndex,
... zope.container.contained.Contained,
... ):
- ... zope.interface.implements(zope.app.catalog.interfaces.ICatalogIndex)
+ ... zope.interface.implements(zope.catalog.interfaces.ICatalogIndex)
Now, we'll add a hobbies index:
Deleted: zope.catalog/trunk/src/zope/catalog/SETUP.cfg
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/SETUP.cfg 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/SETUP.cfg 2009-02-01 15:55:13 UTC (rev 95860)
@@ -1,3 +0,0 @@
-<data-files zopeskel/etc/package-includes>
- *-configure.zcml
-</data-files>
Modified: zope.catalog/trunk/src/zope/catalog/apidoc.zcml
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/apidoc.zcml 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/apidoc.zcml 2009-02-01 15:55:13 UTC (rev 95860)
@@ -1,36 +1,38 @@
-<?xml version="1.0" encoding="utf-8"?>
<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:apidoc="http://namespaces.zope.org/apidoc"
- xmlns:zcml="http://namespaces.zope.org/zcml"
- zcml:condition="have apidoc"
- i18n_domain="zope"
- >
+ xmlns="http://namespaces.zope.org/apidoc"
+ xmlns:zcml="http://namespaces.zope.org/zcml"
+ zcml:condition="have apidoc"
+ i18n_domain="zope"
+ >
- <apidoc:bookchapter
- id="indexcatalog"
- title="Indexes and Catalogs"
- />
- <apidoc:bookchapter
- id="catalog"
- title="Catalog"
- doc_path="README.txt"
- parent="indexcatalog"
- />
+ <bookchapter
+ id="indexcatalog"
+ title="Indexes and Catalogs"
+ />
- <configure package="zope.index">
- <apidoc:bookchapter
- id="fieldindex"
- title="Field Indexes"
- doc_path="field/README.txt"
- parent="indexcatalog"
- />
- <apidoc:bookchapter
- id="testindex"
- title="Text Indexes"
- doc_path="text/textindex.txt"
- parent="indexcatalog"
- />
- </configure>
+ <bookchapter
+ id="catalog"
+ title="Catalog"
+ doc_path="README.txt"
+ parent="indexcatalog"
+ />
+ <configure package="zope.index">
+
+ <bookchapter
+ id="fieldindex"
+ title="Field Indexes"
+ doc_path="field/README.txt"
+ parent="indexcatalog"
+ />
+
+ <bookchapter
+ id="testindex"
+ title="Text Indexes"
+ doc_path="text/textindex.txt"
+ parent="indexcatalog"
+ />
+
+ </configure>
+
</configure>
Modified: zope.catalog/trunk/src/zope/catalog/attribute.py
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/attribute.py 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/attribute.py 2009-02-01 15:55:13 UTC (rev 95860)
@@ -18,7 +18,7 @@
__docformat__ = 'restructuredtext'
import zope.interface
-from zope.app.catalog.interfaces import IAttributeIndex
+from zope.catalog.interfaces import IAttributeIndex
class AttributeIndex(object):
"""Index interface-defined attributes
Modified: zope.catalog/trunk/src/zope/catalog/catalog.py
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/catalog.py 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/catalog.py 2009-02-01 15:55:13 UTC (rev 95860)
@@ -18,19 +18,18 @@
__docformat__ = 'restructuredtext'
import BTrees
-
import zope.index.interfaces
from zope import component
-from zope.interface import implements
from zope.annotation.interfaces import IAttributeAnnotatable
-
-from zope.container.interfaces import IContainer
from zope.container.btree import BTreeContainer
-from zope.app.catalog.interfaces import ICatalog, INoAutoIndex, INoAutoReindex
-from zope.app.intid.interfaces import IIntIds
-from zope.traversing.interfaces import IPhysicallyLocatable
+from zope.container.interfaces import IObjectAddedEvent
+from zope.interface import implements
+from zope.intid.interfaces import IIntIds, IIntIdAddedEvent, IIntIdRemovedEvent
+from zope.lifecycleevent import IObjectModifiedEvent
from zope.location import location
+from zope.location.interfaces import ILocationInfo
+from zope.catalog.interfaces import ICatalog, INoAutoIndex, INoAutoReindex, ICatalogIndex
class ResultSet:
"""Lazily accessed set of objects."""
@@ -51,7 +50,6 @@
class Catalog(BTreeContainer):
implements(ICatalog,
- IContainer,
IAttributeAnnotatable,
zope.index.interfaces.IIndexSearch,
)
@@ -82,7 +80,7 @@
the nearest site if the catalog itself is locatable.
"""
uidutil = None
- locatable = IPhysicallyLocatable(self, None)
+ locatable = ILocationInfo(self, None)
if locatable is not None :
site = locatable.getNearestSite()
sm = site.getSiteManager()
@@ -155,6 +153,7 @@
results = ResultSet(results, uidutil)
return results
+ at component.adapter(ICatalogIndex, IObjectAddedEvent)
def indexAdded(index, event):
"""When an index is added to a catalog, we have to index existing objects
@@ -176,6 +175,7 @@
"""
index.__parent__.updateIndex(index)
+ at component.adapter(IIntIdAddedEvent)
def indexDocSubscriber(event):
"""A subscriber to IntIdAddedEvent"""
ob = event.object
@@ -186,6 +186,7 @@
cat.index_doc(id, ob)
+ at component.adapter(IObjectModifiedEvent)
def reindexDocSubscriber(event):
"""A subscriber to ObjectModifiedEvent"""
ob = event.object
@@ -197,6 +198,7 @@
cat.index_doc(id, ob)
+ at component.adapter(IIntIdRemovedEvent)
def unindexDocSubscriber(event):
"""A subscriber to IntIdRemovedEvent"""
ob = event.object
Modified: zope.catalog/trunk/src/zope/catalog/classes.zcml
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/classes.zcml 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/classes.zcml 2009-02-01 15:55:13 UTC (rev 95860)
@@ -1,70 +1,54 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser"
- >
+<configure xmlns="http://namespaces.zope.org/zope">
- <class class=".catalog.Catalog">
- <factory
- id="zope.app.catalog"
- />
- <implements
- interface="zope.annotation.interfaces.IAttributeAnnotatable"
- />
- <require
- interface="zope.app.catalog.interfaces.ICatalogQuery"
- permission="zope.Public"
- />
- <require
- interface="zope.app.catalog.interfaces.ICatalogEdit"
- permission="zope.ManageServices"
- />
- <require
- interface="zope.container.interfaces.IContainer"
- permission="zope.ManageServices"
- />
- </class>
+ <class class=".catalog.Catalog">
+ <factory id="zope.app.catalog" />
+ <allow interface=".interfaces.ICatalogQuery" />
+ <require
+ interface=".interfaces.ICatalogEdit"
+ permission="zope.ManageServices"
+ />
+ <require
+ interface="zope.container.interfaces.IContainer"
+ permission="zope.ManageServices"
+ />
+ </class>
- <class class=".catalog.ResultSet">
- <require
- attributes="__iter__ __len__"
- permission="zope.Public"
- />
- </class>
+ <class class=".catalog.ResultSet">
+ <allow attributes="__iter__ __len__" />
+ </class>
- <class class=".field.FieldIndex">
- <require
- permission="zope.ManageServices"
- interface=".interfaces.IAttributeIndex
- zope.index.interfaces.IStatistics
- "
- set_schema=".interfaces.IAttributeIndex"
- />
- </class>
+ <class class=".field.FieldIndex">
+ <require
+ permission="zope.ManageServices"
+ interface=".interfaces.IAttributeIndex
+ zope.index.interfaces.IStatistics"
+ set_schema=".interfaces.IAttributeIndex"
+ />
+ </class>
- <class class=".keyword.KeywordIndex">
- <require
- permission="zope.ManageServices"
- interface=".interfaces.IAttributeIndex
- zope.index.interfaces.IStatistics"
- set_schema=".interfaces.IAttributeIndex"
- />
- </class>
+ <class class=".keyword.KeywordIndex">
+ <require
+ permission="zope.ManageServices"
+ interface=".interfaces.IAttributeIndex
+ zope.index.interfaces.IStatistics"
+ set_schema=".interfaces.IAttributeIndex"
+ />
+ </class>
- <class class=".keyword.CaseInsensitiveKeywordIndex">
- <require like_class=".keyword.KeywordIndex" />
- </class>
+ <class class=".keyword.CaseInsensitiveKeywordIndex">
+ <require like_class=".keyword.KeywordIndex" />
+ </class>
- <class class=".text.TextIndex">
- <require
- permission="zope.ManageServices"
- interface=".interfaces.IAttributeIndex
- zope.index.interfaces.IStatistics
- "
- set_schema=".interfaces.IAttributeIndex"
- />
- </class>
+ <class class=".text.TextIndex">
+ <require
+ permission="zope.ManageServices"
+ interface=".interfaces.IAttributeIndex
+ zope.index.interfaces.IStatistics
+ "
+ set_schema=".interfaces.IAttributeIndex"
+ />
+ </class>
- <interface interface="zope.index.text.interfaces.ISearchableText" />
+ <interface interface="zope.index.text.interfaces.ISearchableText" />
</configure>
Modified: zope.catalog/trunk/src/zope/catalog/configure.zcml
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/configure.zcml 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/configure.zcml 2009-02-01 15:55:13 UTC (rev 95860)
@@ -1,9 +1,7 @@
<configure xmlns="http://namespaces.zope.org/zope">
- <include file="classes.zcml" />
- <include file="subscribers.zcml" />
- <include file="apidoc.zcml" />
+ <include file="classes.zcml" />
+ <include file="subscribers.zcml" />
+ <include file="apidoc.zcml" />
- <include package=".browser" />
-
</configure>
Modified: zope.catalog/trunk/src/zope/catalog/event.txt
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/event.txt 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/event.txt 2009-02-01 15:55:13 UTC (rev 95860)
@@ -10,7 +10,7 @@
Let us create a fake catalog to demonstrate this behaviour. We only
need to implement the index_doc method for this test.
- >>> from zope.app.catalog.interfaces import ICatalog
+ >>> from zope.catalog.interfaces import ICatalog
>>> from zope import interface, component
>>> class FakeCatalog(object):
... indexed = []
@@ -22,11 +22,11 @@
We also need an intid util and a keyreference adapter.
- >>> from zope.app.intid import IntIds
- >>> from zope.app.intid.interfaces import IIntIds
+ >>> from zope.intid import IntIds
+ >>> from zope.intid.interfaces import IIntIds
>>> intids = IntIds()
>>> component.provideUtility(intids, IIntIds)
- >>> from zope.app.keyreference.testing import SimpleKeyReference
+ >>> from zope.keyreference.testing import SimpleKeyReference
>>> component.provideAdapter(SimpleKeyReference)
>>> from zope.container.contained import Contained
@@ -38,8 +38,8 @@
We have a subscriber to IIntidAddedEvent.
- >>> from zope.app.catalog import catalog
- >>> from zope.app.intid.interfaces import IntIdAddedEvent
+ >>> from zope.catalog import catalog
+ >>> from zope.intid.interfaces import IntIdAddedEvent
>>> d1 = Dummy(u'one')
>>> id1 = intids.register(d1)
>>> catalog.indexDocSubscriber(IntIdAddedEvent(d1, None))
@@ -67,7 +67,7 @@
specific indexes needs to be updated. There are marker interfaces to
achieve this.
- >>> from zope.app.catalog.interfaces import INoAutoIndex
+ >>> from zope.catalog.interfaces import INoAutoIndex
If an object provides this interface it is not automatically indexed.
@@ -76,7 +76,7 @@
>>> len(cat.indexed)
0
- >>> from zope.app.catalog.interfaces import INoAutoReindex
+ >>> from zope.catalog.interfaces import INoAutoReindex
If an object provides this interface it is not automatically reindexed.
Modified: zope.catalog/trunk/src/zope/catalog/field.py
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/field.py 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/field.py 2009-02-01 15:55:13 UTC (rev 95860)
@@ -18,19 +18,17 @@
import zope.index.field
import zope.interface
+import zope.catalog.attribute
+import zope.catalog.interfaces
import zope.container.contained
-import zope.app.catalog.attribute
-import zope.app.catalog.interfaces
-class IFieldIndex(zope.app.catalog.interfaces.IAttributeIndex,
- zope.app.catalog.interfaces.ICatalogIndex):
+class IFieldIndex(zope.catalog.interfaces.IAttributeIndex,
+ zope.catalog.interfaces.ICatalogIndex):
"""Interface-based catalog field index
"""
-class FieldIndex(zope.app.catalog.attribute.AttributeIndex,
+class FieldIndex(zope.catalog.attribute.AttributeIndex,
zope.index.field.FieldIndex,
zope.container.contained.Contained):
zope.interface.implements(IFieldIndex)
-
-
Deleted: zope.catalog/trunk/src/zope/catalog/ftesting.zcml
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/ftesting.zcml 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/ftesting.zcml 2009-02-01 15:55:13 UTC (rev 95860)
@@ -1,48 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/zope"
- i18n_domain="zope"
- package="zope.app.catalog"
- >
-
- <!-- This file is the equivalent of site.zcml and it is -->
- <!-- used for functional testing setup -->
-
- <include package="zope.app.securitypolicy" file="meta.zcml" />
-
- <include package="zope.app.zcmlfiles" />
-
- <include package="zope.formlib" />
- <include package="zope.app.zptpage"/>
- <include package="zope.app.authentication" />
- <include package="zope.app.keyreference" />
- <include package="zope.app.intid" />
- <include package="zope.app.catalog"/>
- <include package="zope.app.zptpage.textindex" />
-
- <include package="zope.app.securitypolicy" />
-
- <securityPolicy
- component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
-
- <role id="zope.Manager" title="Site Manager" />
-
- <grantAll role="zope.Manager" />
- <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
-
- <!-- Principal that tests generally run as -->
- <principal
- id="zope.mgr"
- title="Manager"
- login="mgr"
- password="mgrpw" />
-
- <!-- Bootstrap principal used to make local grant to the principal above -->
- <principal
- id="zope.globalmgr"
- title="Manager"
- login="globalmgr"
- password="globalmgrpw" />
-
- <grant role="zope.Manager" principal="zope.globalmgr" />
-
-</configure>
Modified: zope.catalog/trunk/src/zope/catalog/interfaces.py
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/interfaces.py 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/interfaces.py 2009-02-01 15:55:13 UTC (rev 95860)
@@ -60,6 +60,8 @@
):
"""An index to be used in a catalog
"""
+ zope.container.constraints.containers('.ICatalog')
+
__parent__ = zope.schema.Field()
@@ -69,9 +71,6 @@
zope.container.constraints.contains(ICatalogIndex)
-ICatalogIndex['__parent__'].constraint = (
- zope.container.constraints.ContainerTypesConstraint(ICatalog))
-
class IAttributeIndex(zope.interface.Interface):
"""I index objects by first adapting them to an interface, then
retrieving a field on the adapted object.
Modified: zope.catalog/trunk/src/zope/catalog/keyword.py
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/keyword.py 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/keyword.py 2009-02-01 15:55:13 UTC (rev 95860)
@@ -19,21 +19,21 @@
import zope.interface
import zope.container.contained
-import zope.app.catalog.attribute
-import zope.app.catalog.interfaces
+import zope.catalog.attribute
+import zope.catalog.interfaces
-class IKeywordIndex(zope.app.catalog.interfaces.IAttributeIndex,
- zope.app.catalog.interfaces.ICatalogIndex):
+class IKeywordIndex(zope.catalog.interfaces.IAttributeIndex,
+ zope.catalog.interfaces.ICatalogIndex):
"""Interface-based catalog keyword index"""
-class KeywordIndex(zope.app.catalog.attribute.AttributeIndex,
- zope.index.keyword.KeywordIndex,
- zope.container.contained.Contained):
+class KeywordIndex(zope.catalog.attribute.AttributeIndex,
+ zope.index.keyword.KeywordIndex,
+ zope.container.contained.Contained):
zope.interface.implements(IKeywordIndex)
-class CaseInsensitiveKeywordIndex(zope.app.catalog.attribute.AttributeIndex,
- zope.index.keyword.CaseInsensitiveKeywordIndex,
- zope.container.contained.Contained):
+class CaseInsensitiveKeywordIndex(zope.catalog.attribute.AttributeIndex,
+ zope.index.keyword.CaseInsensitiveKeywordIndex,
+ zope.container.contained.Contained):
zope.interface.implements(IKeywordIndex)
Modified: zope.catalog/trunk/src/zope/catalog/subscribers.zcml
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/subscribers.zcml 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/subscribers.zcml 2009-02-01 15:55:13 UTC (rev 95860)
@@ -1,28 +1,8 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser"
- >
+<configure xmlns="http://namespaces.zope.org/zope">
- <subscriber
- handler=".catalog.indexAdded"
- for=".interfaces.ICatalogIndex
- zope.container.interfaces.IObjectAddedEvent"
- />
+ <subscriber handler=".catalog.indexAdded" />
+ <subscriber handler=".catalog.indexDocSubscriber" />
+ <subscriber handler=".catalog.reindexDocSubscriber" />
+ <subscriber handler=".catalog.unindexDocSubscriber" />
- <subscriber
- handler=".catalog.indexDocSubscriber"
- for="zope.app.intid.interfaces.IIntIdAddedEvent"
- />
-
- <subscriber
- handler=".catalog.reindexDocSubscriber"
- for="zope.lifecycleevent.interfaces.IObjectModifiedEvent"
- />
-
- <subscriber
- handler=".catalog.unindexDocSubscriber"
- for="zope.app.intid.interfaces.IIntIdRemovedEvent"
- />
-
</configure>
Deleted: zope.catalog/trunk/src/zope/catalog/testing.py
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/testing.py 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/testing.py 2009-02-01 15:55:13 UTC (rev 95860)
@@ -1,27 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 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.app.catalog common test related classes/functions/objects.
-
-$Id$
-"""
-
-__docformat__ = "reStructuredText"
-
-import os
-from zope.app.testing.functional import ZCMLLayer
-
-AppCatalogLayer = ZCMLLayer(
- os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
- __name__, 'AppCatalogLayer', allow_teardown=True)
-
Modified: zope.catalog/trunk/src/zope/catalog/tests.py
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/tests.py 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/tests.py 2009-02-01 15:55:13 UTC (rev 95860)
@@ -22,16 +22,17 @@
from zope.testing import doctest
from zope.interface import implements
from zope.interface.verify import verifyObject
-from zope.app.testing import ztapi, setup, placelesssetup
+from zope.app.testing import setup, placelesssetup
from BTrees.IFBTree import IFSet
-from zope.app.intid.interfaces import IIntIds
-from zope.app.component.hooks import setSite
+from zope.intid.interfaces import IIntIds
+from zope.site.hooks import setSite
from zope.location.location import Location
+from zope.component import provideUtility
from zope.index.interfaces import IInjection, IIndexSearch
-from zope.app.catalog.interfaces import ICatalog
-from zope.app.catalog.catalog import Catalog
-from zope.app.catalog.field import FieldIndex
+from zope.catalog.interfaces import ICatalog
+from zope.catalog.catalog import Catalog
+from zope.catalog.field import FieldIndex
class ReferenceStub:
def __init__(self, obj):
@@ -130,7 +131,7 @@
def _frob_intidutil(self, ints=True, apes=True):
uidutil = IntIdsStub()
- ztapi.provideUtility(IIntIds, uidutil)
+ provideUtility(uidutil, IIntIds)
# whack some objects in our little objecthub
if ints:
for i in range(10):
@@ -231,9 +232,9 @@
setup.placefulTearDown()
def test_indexDocSubscriber(self):
- from zope.app.catalog.catalog import indexDocSubscriber
+ from zope.catalog.catalog import indexDocSubscriber
from zope.container.contained import ObjectAddedEvent
- from zope.app.intid.interfaces import IntIdAddedEvent
+ from zope.intid.interfaces import IntIdAddedEvent
ob = Stub()
ob2 = Stub()
@@ -248,7 +249,7 @@
self.assertEqual(self.cat.unregs, [])
def test_reindexDocSubscriber(self):
- from zope.app.catalog.catalog import reindexDocSubscriber
+ from zope.catalog.catalog import reindexDocSubscriber
from zope.lifecycleevent import ObjectModifiedEvent
ob = Stub()
@@ -270,9 +271,9 @@
def test_unindexDocSubscriber(self):
- from zope.app.catalog.catalog import unindexDocSubscriber
+ from zope.catalog.catalog import unindexDocSubscriber
from zope.container.contained import ObjectRemovedEvent
- from zope.app.intid.interfaces import IntIdRemovedEvent
+ from zope.intid.interfaces import IntIdRemovedEvent
ob = Stub()
ob2 = Stub()
@@ -307,7 +308,7 @@
setup.placefulSetUp(True)
- from zope.app.catalog.catalog import Catalog
+ from zope.catalog.catalog import Catalog
self.root = setup.buildSampleFolderTree()
@@ -377,7 +378,7 @@
setup.placefulSetUp(True)
- from zope.app.catalog.catalog import Catalog
+ from zope.catalog.catalog import Catalog
self.root = setup.buildSampleFolderTree()
@@ -410,7 +411,7 @@
and call the updateIndexes method. The indexed objects should should
be restricted to the sublocations.
"""
- from zope.app.catalog.catalog import indexDocSubscriber
+ from zope.catalog.catalog import indexDocSubscriber
from zope.container.contained import ObjectAddedEvent
ob = Stub()
@@ -435,7 +436,7 @@
and call the updateIndexes method. The indexed objects should should
be restricted to the sublocations.
"""
- from zope.app.catalog.catalog import reindexDocSubscriber
+ from zope.catalog.catalog import reindexDocSubscriber
from zope.lifecycleevent import ObjectModifiedEvent
ob = Stub()
@@ -459,9 +460,9 @@
and call the updateIndexes method. The indexed objects should should
be restricted to the sublocations.
"""
- from zope.app.catalog.catalog import indexDocSubscriber
+ from zope.catalog.catalog import indexDocSubscriber
+ from zope.catalog.catalog import unindexDocSubscriber
from zope.container.contained import ObjectAddedEvent
- from zope.app.catalog.catalog import unindexDocSubscriber
from zope.container.contained import ObjectRemovedEvent
ob = Stub()
@@ -495,7 +496,7 @@
def test_updateIndexWithNone(self):
uidutil = IntIdsStub()
- ztapi.provideUtility(IIntIds, uidutil)
+ provideUtility(uidutil, IIntIds)
catalog = Catalog()
index = FieldIndex('author', None)
@@ -520,7 +521,7 @@
def test_updateIndexFromCallableWithNone(self):
uidutil = IntIdsStub()
- ztapi.provideUtility(IIntIds, uidutil)
+ provideUtility(uidutil, IIntIds)
catalog = Catalog()
index = FieldIndex('getAuthor', None, field_callable=True)
@@ -560,7 +561,7 @@
Raising an exception in the method should not be silently ignored
That would cause index corruption -- the index would be out of sync"""
uidutil = IntIdsStub()
- ztapi.provideUtility(IIntIds, uidutil)
+ provideUtility(uidutil, IIntIds)
catalog = Catalog()
index = FieldIndex('getAuthor', None, field_callable=True)
@@ -598,7 +599,7 @@
suite.addTest(unittest.makeSuite(TestSubSiteCatalog))
suite.addTest(unittest.makeSuite(TestCatalogBugs))
suite.addTest(unittest.makeSuite(TestIndexRaisingValueGetter))
- suite.addTest(doctest.DocTestSuite('zope.app.catalog.attribute'))
+ suite.addTest(doctest.DocTestSuite('zope.catalog.attribute'))
suite.addTest(doctest.DocFileSuite(
'README.txt',
setUp=placelesssetup.setUp,
Modified: zope.catalog/trunk/src/zope/catalog/text.py
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/text.py 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/text.py 2009-02-01 15:55:13 UTC (rev 95860)
@@ -19,13 +19,13 @@
import zope.index.text.interfaces
import zope.interface
-import zope.app.catalog.attribute
-import zope.app.catalog.interfaces
+import zope.catalog.attribute
+import zope.catalog.interfaces
import zope.container.contained
from zope.i18nmessageid import ZopeMessageFactory as _
-class ITextIndex(zope.app.catalog.interfaces.IAttributeIndex,
- zope.app.catalog.interfaces.ICatalogIndex):
+class ITextIndex(zope.catalog.interfaces.IAttributeIndex,
+ zope.catalog.interfaces.ICatalogIndex):
"""Interface-based catalog text index
"""
@@ -50,7 +50,7 @@
default=True,
)
-class TextIndex(zope.app.catalog.attribute.AttributeIndex,
+class TextIndex(zope.catalog.attribute.AttributeIndex,
zope.index.text.TextIndex,
zope.container.contained.Contained):
Deleted: zope.catalog/trunk/src/zope/catalog/zope.app.catalog-configure.zcml
===================================================================
--- zope.app.catalog/trunk/src/zope/app/catalog/zope.app.catalog-configure.zcml 2009-02-01 13:24:40 UTC (rev 95854)
+++ zope.catalog/trunk/src/zope/catalog/zope.app.catalog-configure.zcml 2009-02-01 15:55:13 UTC (rev 95860)
@@ -1 +0,0 @@
-<include package="zope.app.catalog"/>
More information about the Checkins
mailing list