/usr/share/pyshared/zope/catalog/interfaces.py is in python-zope.catalog 3.8.2-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | ##############################################################################
#
# Copyright (c) 2004 Zope Foundation 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.
#
##############################################################################
"""Catalog Interfaces
"""
import zope.index.interfaces
import zope.interface
import zope.schema
import zope.container.interfaces
import zope.container.constraints
from zope.i18nmessageid import ZopeMessageFactory as _
class ICatalogQuery(zope.interface.Interface):
"""Provides Catalog Queries."""
def searchResults(**kw):
"""Search on the given indexes.
Keyword arguments dictionary keys
are index names and values are queries
for these indexes.
Keyword arguments has some special names,
used by the catalog itself:
* _sort_index - The name of index to sort
results with. This index must implement
zope.index.interfaces.IIndexSort.
* _limit - Limit result set by this number,
useful when used with sorting.
* _reverse - Reverse result set, also
useful with sorting.
"""
class ICatalogEdit(zope.index.interfaces.IInjection):
"""Allows one to manipulate the Catalog information."""
def updateIndexes():
"""Reindex all objects."""
class ICatalogIndex(zope.index.interfaces.IInjection,
zope.index.interfaces.IIndexSearch,
):
"""An index to be used in a catalog
"""
__parent__ = zope.schema.Field()
zope.container.constraints.containers('.ICatalog')
class ICatalog(ICatalogQuery, ICatalogEdit,
zope.container.interfaces.IContainer):
"""Marker to describe a catalog in content space."""
zope.container.constraints.contains(ICatalogIndex)
class IAttributeIndex(zope.interface.Interface):
"""I index objects by first adapting them to an interface, then
retrieving a field on the adapted object.
"""
interface = zope.schema.Choice(
title=_(u"Interface"),
description=_(u"Objects will be adapted to this interface"),
vocabulary="Interfaces",
required=False,
)
field_name = zope.schema.BytesLine(
title=_(u"Field Name"),
description=_(u"Name of the field to index"),
)
field_callable = zope.schema.Bool(
title=_(u"Field Callable"),
description=_(u"If true, then the field should be called to get the "
u"value to be indexed"),
)
class INoAutoIndex(zope.interface.Interface):
"""Marker for objects that should not be automatically indexed"""
class INoAutoReindex(zope.interface.Interface):
"""Marker for objects that should not be automatically reindexed"""
|