/usr/share/pyshared/hurry/query/set.py is in python-hurry.query 1.1.0-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 | ##############################################################################
#
# Copyright (c) 2005-2009 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.
#
##############################################################################
"""Query terms for zc.catalog's SetIndex
$Id: set.py 112992 2010-06-03 08:22:48Z janwijbrand $
"""
from zc.catalog.interfaces import ISetIndex
from hurry.query import query
class SetTerm(query.IndexTerm):
def getIndex(self, context):
index = super(SetTerm, self).getIndex(context)
assert ISetIndex.providedBy(index)
return index
class AnyOf(SetTerm):
def __init__(self, index_id, values):
super(AnyOf, self).__init__(index_id)
self.values = values
def apply(self, context=None):
return self.getIndex(context).apply({'any_of': self.values})
class AllOf(SetTerm):
def __init__(self, index_id, values):
super(AllOf, self).__init__(index_id)
self.values = values
def apply(self, context=None):
return self.getIndex(context).apply({'all_of': self.values})
class SetBetween(SetTerm):
def __init__(self, index_id,
minimum=None, maximum=None,
include_minimum=False, include_maximum=False):
super(SetBetween, self).__init__(index_id)
self.tuple = (minimum, maximum, include_minimum, include_maximum)
def apply(self, context=None):
return self.getIndex(context).apply({'between': self.tuple})
class ExtentAny(SetTerm):
"""Any ids in the extent that are indexed by this index."""
def __init__(self, index_id, extent):
super(Any, self).__init__(index_id)
self.extent = extent
def apply(self, context=None):
return self.getIndex(context).apply({'any': self.extent})
class ExtentNone(SetTerm):
"""Any ids in the extent that are not indexed by this index."""
def __init__(self, extent):
super(None, self).__init__(index_id)
self.extent = extent
def apply(self, context=None):
return self.getIndex(context).apply({'none': self.extent})
|