[Checkins] SVN: grokcore.catalog/trunk/s Tests DO pass.
Souheil Chelfouh
cvs-admin at zope.org
Sun Apr 29 12:50:10 UTC 2012
Log message for revision 125374:
Tests DO pass.
Changed:
U grokcore.catalog/trunk/setup.py
U grokcore.catalog/trunk/src/grokcore/catalog/configure.zcml
U grokcore.catalog/trunk/src/grokcore/catalog/ftesting.zcml
U grokcore.catalog/trunk/src/grokcore/catalog/ftests/test_grok_functional.py
U grokcore.catalog/trunk/src/grokcore/catalog/index.py
U grokcore.catalog/trunk/src/grokcore/catalog/meta.py
U grokcore.catalog/trunk/src/grokcore/catalog/tests/catalog/indexes_no_app.py
-=-
Modified: grokcore.catalog/trunk/setup.py
===================================================================
--- grokcore.catalog/trunk/setup.py 2012-04-29 12:15:13 UTC (rev 125373)
+++ grokcore.catalog/trunk/setup.py 2012-04-29 12:50:06 UTC (rev 125374)
@@ -18,6 +18,7 @@
'zope.configuration',
'zope.location',
'zope.testing',
+ 'zope.app.wsgi',
]
setup(
@@ -57,6 +58,7 @@
'zope.interface',
'zope.intid',
'zope.lifecycleevent',
+ 'zope.keyreference',
'zope.site',
],
tests_require=tests_require,
Modified: grokcore.catalog/trunk/src/grokcore/catalog/configure.zcml
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/configure.zcml 2012-04-29 12:15:13 UTC (rev 125373)
+++ grokcore.catalog/trunk/src/grokcore/catalog/configure.zcml 2012-04-29 12:50:06 UTC (rev 125374)
@@ -2,12 +2,16 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:grok="http://namespaces.zope.org/grok">
-
<include package="zope.catalog" />
<include package="zope.intid" />
+ <include package="zope.keyreference" />
+
+ <include package="zope.catalog" file="subscribers.zcml" />
+
+ <include package="grokcore.site" />
<include package="grokcore.site" file="meta.zcml" />
+ <include package="zope.intid" file="subscribers.zcml" />
+
<include package="." file="meta.zcml" />
- <include package="zope.container" />
- <include package="grokcore.site" />
</configure>
Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftesting.zcml
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftesting.zcml 2012-04-29 12:15:13 UTC (rev 125373)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftesting.zcml 2012-04-29 12:50:06 UTC (rev 125374)
@@ -4,6 +4,8 @@
i18n_domain="grokcore.catalog"
package="grokcore.catalog">
+
+ <include package="zope.container" />
<include package="zope.app.appsetup" file="ftesting.zcml" />
<include package="grokcore.catalog" />
<grok:grok package="grokcore.catalog.ftests" />
Modified: grokcore.catalog/trunk/src/grokcore/catalog/ftests/test_grok_functional.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/ftests/test_grok_functional.py 2012-04-29 12:15:13 UTC (rev 125373)
+++ grokcore.catalog/trunk/src/grokcore/catalog/ftests/test_grok_functional.py 2012-04-29 12:50:06 UTC (rev 125374)
@@ -5,10 +5,10 @@
from pkg_resources import resource_listdir
from zope.testing import doctest
-from zope.app.appsetup.testlayer import ZODBLayer
+from zope.app.wsgi.testlayer import BrowserLayer
-FunctionalLayer = ZODBLayer(grokcore.catalog)
+FunctionalLayer = BrowserLayer(grokcore.catalog)
def suiteFromPackage(name):
Modified: grokcore.catalog/trunk/src/grokcore/catalog/index.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/index.py 2012-04-29 12:15:13 UTC (rev 125373)
+++ grokcore.catalog/trunk/src/grokcore/catalog/index.py 2012-04-29 12:50:06 UTC (rev 125374)
@@ -29,15 +29,15 @@
class IndexDefinition(object):
- """The definition of a particular index in a :data:`grok.Indexes`
- class.
+ """The definition of a particular index in a
+ :data:`grokcore.catalog.Indexes` class.
This base class defines the actual behavior of
:class:`grokcore.catalog.index.Field` and the other kinds of attribute
index that Grok supports. Upon our instantiation, we save every
parameter that we were passed; later, if an index actually needs
to be created (which is typically at the moment when a new
- :class:`grok.Application` object is added to the Zope Database),
+ :class:`grokcore.site.Application` object is added to the Zope Database),
then our :meth:`setup()` method gets called.
The only parameter that is actually significant to us is `attribute`
@@ -69,7 +69,8 @@
def setup(self, catalog, name, context, module_info):
# If the user supplied attribute= when instantiating us, we
# allow that value to override the attribute name under which we
- # are actually stored inside of the `grok.Indexes` instance.
+ # are actually stored inside of the `grokcore.catalog.Indexes`
+ # instance.
if self._attribute is not None:
field_name = self._attribute
else:
@@ -79,10 +80,11 @@
try:
method = context[field_name]
except KeyError:
- raise GrokError("grok.Indexes in %r refers to an attribute or "
- "method %r on interface %r, but this does not "
- "exist." % (module_info.getModule(),
- field_name, context), None)
+ raise GrokError(
+ "grokcore.catalog.Indexes in %r refers to an attribute or "
+ "method %r on interface %r, but this does not "
+ "exist." % (module_info.getModule(),
+ field_name, context), None)
call = IMethod.providedBy(method)
else:
call = callable(getattr(context, field_name, None))
@@ -94,24 +96,29 @@
class Field(IndexDefinition):
- """A :class:`grok.Indexes` index that matches against an entire field."""
+ """A :class:`grokcore.catalog.Indexes` index that matches
+ against an entire field.
+ """
index_class = FieldIndex
class Text(IndexDefinition):
- """A :class:`grok.Indexes` index supporting full-text searches of a
- field."""
+ """A :class:`grokcore.catalog.Indexes` index supporting
+ full-text searches of a field.
+ """
index_class = TextIndex
class Set(IndexDefinition):
- """A :class:`grok.Indexes` index supporting keyword searches of a field."""
+ """A :class:`grokcore.catalog.Indexes` index supporting
+ keyword searches of a field.
+ """
index_class = SetIndex
class Value(IndexDefinition):
- """A :class:`grok.Indexes` index similar to, but more flexible than
- :class:`grok.Field` index.
+ """A :class:`grokcore.catalog.Indexes` index similar to,
+ but more flexible than :class:`grokcore.catalog.Field` index.
The index allows searches for documents that contain any of a set of
values; between a set of values; any (non-None) values; and any empty
Modified: grokcore.catalog/trunk/src/grokcore/catalog/meta.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/meta.py 2012-04-29 12:15:13 UTC (rev 125373)
+++ grokcore.catalog/trunk/src/grokcore/catalog/meta.py 2012-04-29 12:50:06 UTC (rev 125374)
@@ -41,7 +41,7 @@
if site is None:
raise GrokError(
- "No site specified for grok.Indexes "
+ "No site specified for grokcore.catalog.Indexes "
"subclass in module %r. "
"Use grokcore.site.site() to specify."
% module_info.getModule(), factory)
@@ -98,7 +98,7 @@
index.setup(catalog, name, self.context, self.module_info)
except DuplicationError:
raise GrokError(
- "grok.Indexes in module %r causes "
+ "grokcore.catalog.Indexes in module %r causes "
"creation of catalog index %r in catalog %r, "
"but an index with that name is already present." %
(self.module_info.getModule(), name, self.catalog_name),
Modified: grokcore.catalog/trunk/src/grokcore/catalog/tests/catalog/indexes_no_app.py
===================================================================
--- grokcore.catalog/trunk/src/grokcore/catalog/tests/catalog/indexes_no_app.py 2012-04-29 12:15:13 UTC (rev 125373)
+++ grokcore.catalog/trunk/src/grokcore/catalog/tests/catalog/indexes_no_app.py 2012-04-29 12:50:06 UTC (rev 125374)
@@ -7,7 +7,7 @@
>>> testing.grok(__name__)
Traceback (most recent call last):
...
- GrokError: No site specified for grok.Indexes subclass in module
+ GrokError: No site specified for grokcore.catalog.Indexes subclass in module
<module 'grokcore.catalog.tests.catalog.indexes_no_app' from ...>.
Use grokcore.site.site() to specify.
More information about the checkins
mailing list