Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mechanical rename of repoze.catalog to hypatia

  • Loading branch information...
commit 6bb04d4283e509404be5e0bc7e3ef029e5e2e53d 1 parent d965904
@mcdonc mcdonc authored
Showing with 226 additions and 231 deletions.
  1. +3 −0  CONTRIBUTORS.txt
  2. +1 −1  COPYRIGHT.txt
  3. +3 −8 README.rst
  4. 0  {repoze/catalog → hypatia}/__init__.py
  5. +5 −5 {repoze/catalog → hypatia}/catalog.py
  6. 0  {repoze/catalog → hypatia}/document.py
  7. 0  {repoze/catalog → hypatia}/indexes/__init__.py
  8. 0  {repoze/catalog → hypatia}/indexes/common.py
  9. +2 −2 {repoze/catalog → hypatia}/indexes/facet.py
  10. +3 −3 {repoze/catalog → hypatia}/indexes/field.py
  11. +2 −2 {repoze/catalog → hypatia}/indexes/keyword.py
  12. +2 −2 {repoze/catalog → hypatia}/indexes/path.py
  13. +3 −3 {repoze/catalog → hypatia}/indexes/path2.py
  14. 0  {repoze/catalog → hypatia}/indexes/tests/__init__.py
  15. +2 −2 {repoze/catalog → hypatia}/indexes/tests/test_common.py
  16. +3 −3 {repoze/catalog → hypatia}/indexes/tests/test_facet.py
  17. +30 −30 {repoze/catalog → hypatia}/indexes/tests/test_field.py
  18. +3 −3 {repoze/catalog → hypatia}/indexes/tests/test_keyword.py
  19. +3 −3 {repoze/catalog → hypatia}/indexes/tests/test_path.py
  20. +3 −3 {repoze/catalog → hypatia}/indexes/tests/test_path2.py
  21. +3 −3 {repoze/catalog → hypatia}/indexes/tests/test_text.py
  22. +2 −2 {repoze/catalog → hypatia}/indexes/text.py
  23. +0 −1  {repoze/catalog → hypatia}/interfaces.py
  24. 0  {repoze/catalog → hypatia}/migration.py
  25. +2 −2 {repoze/catalog → hypatia}/query.py
  26. 0  {repoze/catalog → hypatia}/tests/__init__.py
  27. +14 −14 {repoze/catalog → hypatia}/tests/test_catalog.py
  28. +1 −1  {repoze/catalog → hypatia}/tests/test_document.py
  29. +5 −5 {repoze/catalog → hypatia}/tests/test_functional.py
  30. +2 −2 {repoze/catalog → hypatia}/tests/test_migration.py
  31. +116 −116 {repoze/catalog → hypatia}/tests/test_query.py
  32. +0 −1  repoze/__init__.py
  33. +4 −4 setup.cfg
  34. +9 −10 setup.py
View
3  CONTRIBUTORS.txt
@@ -104,3 +104,6 @@ Contributors
------------
- Tres Seaver, 2011/02/22
+
+- Chris McDonough, 2012/06/13
+
View
2  COPYRIGHT.txt
@@ -1,3 +1,3 @@
-Copyright (c) 2008 Agendaless Consulting and Contributors.
+Copyright (c) 2012 Agendaless Consulting and Contributors.
(http://www.agendaless.com), All Rights Reserved
View
11 README.rst
@@ -1,11 +1,6 @@
-================
- repoze.catalog
-================
+Hypatia
+=======
-A Python indexing and searching system based on `zope.index`_.
+A Python indexing and searching system.
-.. _`zope.index`: http://pypi.python.org/pypi/zope.index
-
-See the ``docs`` subdirectory for documentation or the `online docs
-<http://docs.repoze.org/catalog/>`_.
View
0  repoze/catalog/__init__.py → hypatia/__init__.py
File renamed without changes
View
10 repoze/catalog/catalog.py → hypatia/catalog.py
@@ -4,8 +4,8 @@
from zope.interface import implements
-from repoze.catalog.interfaces import ICatalog
-from repoze.catalog.interfaces import ICatalogIndex
+from .interfaces import ICatalog
+from .interfaces import ICatalogIndex
class Catalog(PersistentMapping):
@@ -47,7 +47,7 @@ def reindex_doc(self, docid, obj):
def __setitem__(self, name, index):
""" Add an object which implements
- ``repoze.catalog.interfaces.ICatalogIndex`` to the catalog.
+ ``hypatia.interfaces.ICatalogIndex`` to the catalog.
No other type of object may be added to a catalog."""
if not ICatalogIndex.providedBy(index):
raise ValueError('%s does not provide ICatalogIndex')
@@ -61,7 +61,7 @@ def search(self, **query):
.. note::
this method is deprecated as of :mod:`repoze.catalog`
- version 0.8. Use :meth:`repoze.catalog.Catalog.query`
+ version 0.8. Use :meth:`hypatia.Catalog.query`
instead.
@@ -146,7 +146,7 @@ def query(self, queryobject, sort_index=None, limit=None, sort_type=None,
""" Use the arguments to perform a query. Return a tuple of
(num, resultseq)."""
try:
- from repoze.catalog.query import parse_query
+ from .query import parse_query
if isinstance(queryobject, basestring):
queryobject = parse_query(queryobject)
except ImportError: #pragma NO COVERAGE
View
0  repoze/catalog/document.py → hypatia/document.py
File renamed without changes
View
0  repoze/catalog/indexes/__init__.py → hypatia/indexes/__init__.py
File renamed without changes
View
0  repoze/catalog/indexes/common.py → hypatia/indexes/common.py
File renamed without changes
View
4 repoze/catalog/indexes/facet.py → hypatia/indexes/facet.py
@@ -6,8 +6,8 @@
from persistent import Persistent
from zope.interface import implements
-from repoze.catalog.indexes.keyword import CatalogKeywordIndex
-from repoze.catalog.interfaces import ICatalogIndex
+from .keyword import CatalogKeywordIndex
+from ..interfaces import ICatalogIndex
_marker = ()
View
6 repoze/catalog/indexes/field.py → hypatia/indexes/field.py
@@ -6,9 +6,9 @@
from zope.index.field import FieldIndex
-from repoze.catalog.interfaces import ICatalogIndex
-from repoze.catalog.indexes.common import CatalogIndex
-from repoze.catalog import RangeValue
+from ..interfaces import ICatalogIndex
+from .common import CatalogIndex
+from .. import RangeValue
_marker = []
View
4 repoze/catalog/indexes/keyword.py → hypatia/indexes/keyword.py
@@ -2,8 +2,8 @@
from zope.index.keyword import KeywordIndex
-from repoze.catalog.interfaces import ICatalogIndex
-from repoze.catalog.indexes.common import CatalogIndex
+from ..interfaces import ICatalogIndex
+from .common import CatalogIndex
class CatalogKeywordIndex(CatalogIndex, KeywordIndex):
View
4 repoze/catalog/indexes/path.py → hypatia/indexes/path.py
@@ -5,8 +5,8 @@
from BTrees.Length import Length
-from repoze.catalog.interfaces import ICatalogIndex
-from repoze.catalog.indexes.common import CatalogIndex
+from ..interfaces import ICatalogIndex
+from .common import CatalogIndex
_marker = ()
View
6 repoze/catalog/indexes/path2.py → hypatia/indexes/path2.py
@@ -2,8 +2,8 @@
import BTrees
-from repoze.catalog.interfaces import ICatalogIndex
-from repoze.catalog.indexes.common import CatalogIndex
+from ..interfaces import ICatalogIndex
+from .common import CatalogIndex
_marker = object()
@@ -19,7 +19,7 @@ class CatalogPathIndex2(CatalogIndex): #pragma NO COVERAGE
limited by depth) of a certain path.
This index differs from the original
- ``repoze.catalog.indexes.path.CatalogPath`` index inasmuch as it
+ ``hypatia.indexes.path.CatalogPath`` index inasmuch as it
actually retains a graph representation of the objects in the path
space instead of relying on 'level' information; query results
relying on this level information may or may not be correct for
View
0  repoze/catalog/indexes/tests/__init__.py → hypatia/indexes/tests/__init__.py
File renamed without changes
View
4 repoze/catalog/indexes/tests/test_common.py → hypatia/indexes/tests/test_common.py
@@ -2,7 +2,7 @@
class TestCatalogIndex(unittest.TestCase):
def _getTargetClass(self):
- from repoze.catalog.indexes.common import CatalogIndex
+ from ..common import CatalogIndex
return CatalogIndex
def test_ctor(self):
@@ -197,7 +197,7 @@ class Test(klass, DummyIndex):
self.assertEqual(set(index.docids()), set([1, 2, 3, 4]))
-from repoze.catalog.interfaces import ICatalogIndex
+from ...interfaces import ICatalogIndex
from zope.interface import implements
View
6 repoze/catalog/indexes/tests/test_facet.py → hypatia/indexes/tests/test_facet.py
@@ -22,7 +22,7 @@
class TestCatalogFacetIndex(unittest.TestCase):
def _getTargetClass(self):
- from repoze.catalog.indexes.facet import CatalogFacetIndex
+ from ..facet import CatalogFacetIndex
return CatalogFacetIndex
def _makeOne(self, discriminator=None, facets=FACETS, family=_marker):
@@ -43,12 +43,12 @@ def _populateIndex(self, idx):
def test_class_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyClass
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyClass(ICatalogIndex, self._getTargetClass())
def test_instance_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyObject
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyObject(ICatalogIndex, self._makeOne())
def test_ctor_defaults(self):
View
60 repoze/catalog/indexes/tests/test_field.py → hypatia/indexes/tests/test_field.py
@@ -5,7 +5,7 @@
class TestCatalogFieldIndex(unittest.TestCase):
def _getTargetClass(self):
- from repoze.catalog.indexes.field import CatalogFieldIndex
+ from ..field import CatalogFieldIndex
return CatalogFieldIndex
def _makeOne(self, discriminator=_marker):
@@ -32,12 +32,12 @@ def _populateIndex(self, index):
def test_class_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyClass
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyClass(ICatalogIndex, self._getTargetClass())
def test_instance_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyObject
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyObject(ICatalogIndex, self._makeOne())
def test_ctor_callback_discriminator(self):
@@ -139,7 +139,7 @@ def test_sort_bad_sort_type(self):
def test_sort_bad_sort_type_reverse_fwscan(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import FWSCAN
+ from ..field import FWSCAN
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5])
@@ -224,7 +224,7 @@ def test_sort_noforce_reverse_w_limit_timsort(self):
def test_sort_force_fwscan_no_limit(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import FWSCAN
+ from ..field import FWSCAN
index = self._makeOne()
index.force_scan = True
self._populateIndex(index)
@@ -234,7 +234,7 @@ def test_sort_force_fwscan_no_limit(self):
def test_sort_force_fwscan_missing_docid(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import FWSCAN
+ from ..field import FWSCAN
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5, 99])
@@ -244,7 +244,7 @@ def test_sort_force_fwscan_missing_docid(self):
def test_sort_force_fwscan_w_limit(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import FWSCAN
+ from ..field import FWSCAN
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5])
@@ -253,7 +253,7 @@ def test_sort_force_fwscan_w_limit(self):
def test_sort_force_timsort_no_limit(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import TIMSORT
+ from ..field import TIMSORT
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5])
@@ -262,7 +262,7 @@ def test_sort_force_timsort_no_limit(self):
def test_sort_force_timsort_missing_docid(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import TIMSORT
+ from ..field import TIMSORT
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5, 99])
@@ -272,7 +272,7 @@ def test_sort_force_timsort_missing_docid(self):
def test_sort_force_timsort_w_limit(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import TIMSORT
+ from ..field import TIMSORT
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5])
@@ -281,7 +281,7 @@ def test_sort_force_timsort_w_limit(self):
def test_sort_force_timsort_reverse_nolimit(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import TIMSORT
+ from ..field import TIMSORT
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5])
@@ -290,7 +290,7 @@ def test_sort_force_timsort_reverse_nolimit(self):
def test_sort_force_timsort_reverse_missing_docid(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import TIMSORT
+ from ..field import TIMSORT
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5, 99])
@@ -300,7 +300,7 @@ def test_sort_force_timsort_reverse_missing_docid(self):
def test_sort_force_timsort_reverse_withlimit(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import TIMSORT
+ from ..field import TIMSORT
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5])
@@ -309,7 +309,7 @@ def test_sort_force_timsort_reverse_withlimit(self):
def test_sort_force_nbest_no_limit_raises(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import NBEST
+ from ..field import NBEST
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5])
@@ -317,7 +317,7 @@ def test_sort_force_nbest_no_limit_raises(self):
def test_sort_force_nbest(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import NBEST
+ from ..field import NBEST
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5])
@@ -326,7 +326,7 @@ def test_sort_force_nbest(self):
def test_sort_force_nbest_reverse_no_limit_raises(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import NBEST
+ from ..field import NBEST
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5])
@@ -335,7 +335,7 @@ def test_sort_force_nbest_reverse_no_limit_raises(self):
def test_sort_force_nbest_reverse(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import NBEST
+ from ..field import NBEST
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5])
@@ -344,7 +344,7 @@ def test_sort_force_nbest_reverse(self):
def test_sort_force_nbest_missing_docid(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import NBEST
+ from ..field import NBEST
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5, 99])
@@ -353,7 +353,7 @@ def test_sort_force_nbest_missing_docid(self):
def test_sort_force_nbest_reverse_missing_docid(self):
from BTrees.IFBTree import IFSet
- from repoze.catalog.indexes.field import NBEST
+ from ..field import NBEST
index = self._makeOne()
self._populateIndex(index)
c1 = IFSet([1, 2, 3, 4, 5, 99])
@@ -364,7 +364,7 @@ def test_search_single_range_querymember_or(self):
index = self._makeOne()
self._populateIndex(index)
index.index_doc(50, 1)
- from repoze.catalog import RangeValue
+ from hypatia import RangeValue
result = index.search([RangeValue(1,1)])
result = sorted(list(result))
self.assertEqual(result, [5, 50])
@@ -373,7 +373,7 @@ def test_search_double_range_querymember_or(self):
index = self._makeOne()
self._populateIndex(index)
index.index_doc(50, 1)
- from repoze.catalog import RangeValue
+ from hypatia import RangeValue
result = index.search([RangeValue(1,1), RangeValue(1,2)])
result = sorted(list(result))
self.assertEqual(result, [2, 5, 50])
@@ -382,7 +382,7 @@ def test_search_double_range_querymember_and(self):
index = self._makeOne()
self._populateIndex(index)
index.index_doc(50, 1)
- from repoze.catalog import RangeValue
+ from hypatia import RangeValue
result = index.search([RangeValue(1,1), RangeValue(1,2)], 'and')
result = sorted(list(result))
self.assertEqual(result, [5, 50])
@@ -413,7 +413,7 @@ def test_search_double_int_querymember_and(self):
self.assertEqual(result, [])
def test_apply_dict_single_range(self):
- from repoze.catalog import RangeValue
+ from hypatia import RangeValue
index = self._makeOne()
self._populateIndex(index)
index.index_doc(50, 1)
@@ -422,7 +422,7 @@ def test_apply_dict_single_range(self):
self.assertEqual(result, [2, 5, 50])
def test_apply_dict_operator_or_with_ranges(self):
- from repoze.catalog import RangeValue
+ from hypatia import RangeValue
index = self._makeOne()
self._populateIndex(index)
index.index_doc(50, 1)
@@ -432,7 +432,7 @@ def test_apply_dict_operator_or_with_ranges(self):
self.assertEqual(result, [2, 5, 50])
def test_apply_dict_operator_and_with_ranges_and(self):
- from repoze.catalog import RangeValue
+ from hypatia import RangeValue
index = self._makeOne()
self._populateIndex(index)
index.index_doc(50, 1)
@@ -442,7 +442,7 @@ def test_apply_dict_operator_and_with_ranges_and(self):
self.assertEqual(result, [5, 50])
def test_apply_dict_operator_and_with_ranges_or(self):
- from repoze.catalog import RangeValue
+ from hypatia import RangeValue
index = self._makeOne()
self._populateIndex(index)
index.index_doc(50, 1)
@@ -477,7 +477,7 @@ def test_apply_dict_operator_or_with_list_of_ints_and(self):
self.assertEqual(result, [])
def test_apply_dict_operator_or_with_int_and_range_or(self):
- from repoze.catalog import RangeValue
+ from hypatia import RangeValue
index = self._makeOne()
self._populateIndex(index)
index.index_doc(50, 1)
@@ -486,7 +486,7 @@ def test_apply_dict_operator_or_with_int_and_range_or(self):
self.assertEqual(result, [2,5,50])
def test_apply_dict_operator_or_with_int_and_range_and(self):
- from repoze.catalog import RangeValue
+ from hypatia import RangeValue
index = self._makeOne()
self._populateIndex(index)
index.index_doc(50, 1)
@@ -697,7 +697,7 @@ def test_docids_with_indexed_and_not_indexed(self):
class Test_fwscan_wins(unittest.TestCase):
def _callFUT(self, limit, rlen, numdocs):
- from repoze.catalog.indexes.field import fwscan_wins
+ from ..field import fwscan_wins
return fwscan_wins(limit, rlen, numdocs)
def test_numdocs_zero_raises(self):
@@ -783,7 +783,7 @@ def test_w_limit_docratio_ge_8192_lt_16384_over_div(self):
class Test_nbest_ascending_wins(unittest.TestCase):
def _callFUT(self, limit, rlen, numdocs):
- from repoze.catalog.indexes.field import nbest_ascending_wins
+ from ..field import nbest_ascending_wins
return nbest_ascending_wins(limit, rlen, numdocs)
def test_wo_limit(self):
View
6 repoze/catalog/indexes/tests/test_keyword.py → hypatia/indexes/tests/test_keyword.py
@@ -6,7 +6,7 @@
class TestCatalogKeywordIndex(unittest.TestCase):
def _getTargetClass(self):
- from repoze.catalog.indexes.keyword import CatalogKeywordIndex
+ from ..keyword import CatalogKeywordIndex
return CatalogKeywordIndex
def _makeOne(self, discriminator=_marker):
@@ -22,12 +22,12 @@ def _discriminator(obj, default):
def test_class_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyClass
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyClass(ICatalogIndex, self._getTargetClass())
def test_instance_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyObject
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyObject(ICatalogIndex, self._makeOne())
def test_ctor_callback_discriminator(self):
View
6 repoze/catalog/indexes/tests/test_path.py → hypatia/indexes/tests/test_path.py
@@ -7,7 +7,7 @@ class PathIndexTests(unittest.TestCase):
""" Test PathIndex objects
"""
def _getTargetClass(self):
- from repoze.catalog.indexes.path import CatalogPathIndex
+ from ..path import CatalogPathIndex
return CatalogPathIndex
def _makeOne(self, values=None, discriminator=_marker):
@@ -26,12 +26,12 @@ def _discriminator(obj, default):
def test_class_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyClass
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyClass(ICatalogIndex, self._getTargetClass())
def test_instance_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyObject
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyObject(ICatalogIndex, self._makeOne())
def test_ctor_callback_discriminator(self):
View
6 repoze/catalog/indexes/tests/test_path2.py → hypatia/indexes/tests/test_path2.py
@@ -4,7 +4,7 @@
class CatalogPathIndex2Tests(unittest.TestCase):
def _getTargetClass(self):
- from repoze.catalog.indexes.path2 import CatalogPathIndex2
+ from ..path2 import CatalogPathIndex2
return CatalogPathIndex2
def _makeOne(self, values=None,
@@ -23,12 +23,12 @@ def _attr_discriminator(obj, default):
def test_class_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyClass
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyClass(ICatalogIndex, self._getTargetClass())
def test_instance_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyObject
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyObject(ICatalogIndex, self._makeOne())
def test_ctor_callback_discriminator(self):
View
6 repoze/catalog/indexes/tests/test_text.py → hypatia/indexes/tests/test_text.py
@@ -4,7 +4,7 @@
class TestCatalogTextIndex(unittest.TestCase):
def _getTargetClass(self):
- from repoze.catalog.indexes.text import CatalogTextIndex
+ from ..text import CatalogTextIndex
return CatalogTextIndex
def _makeOne(self, discriminator=_marker):
@@ -18,12 +18,12 @@ def _discriminator(obj, default):
def test_class_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyClass
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyClass(ICatalogIndex, self._getTargetClass())
def test_instance_conforms_to_ICatalogIndex(self):
from zope.interface.verify import verifyObject
- from repoze.catalog.interfaces import ICatalogIndex
+ from ...interfaces import ICatalogIndex
verifyObject(ICatalogIndex, self._makeOne())
def test_class_conforms_to_IIndexSort(self):
View
4 repoze/catalog/indexes/text.py → hypatia/indexes/text.py
@@ -3,8 +3,8 @@
from zope.index.interfaces import IIndexSort
from zope.index.text import TextIndex
-from repoze.catalog.interfaces import ICatalogIndex
-from repoze.catalog.indexes.common import CatalogIndex
+from ..interfaces import ICatalogIndex
+from .common import CatalogIndex
class CatalogTextIndex(CatalogIndex, TextIndex):
""" Full-text index.
View
1  repoze/catalog/interfaces.py → hypatia/interfaces.py
@@ -1,5 +1,4 @@
from zope.interface import Interface
-from zope.interface import Attribute
from zope.index.interfaces import IInjection
from zope.index.interfaces import IIndexSearch
View
0  repoze/catalog/migration.py → hypatia/migration.py
File renamed without changes
View
4 repoze/catalog/query.py → hypatia/query.py
@@ -614,8 +614,8 @@ class Name(object):
Example::
- from repoze.catalog.query import Eq
- from repoze.catalog.query import Name
+ from hypatia.query import Eq
+ from hypatia.query import Name
# Define query at module scope
find_cats = Eq('color', Name('color')) & Eq('sex', Name('sex'))
View
0  repoze/catalog/tests/__init__.py → hypatia/tests/__init__.py
File renamed without changes
View
28 repoze/catalog/tests/test_catalog.py → hypatia/tests/test_catalog.py
@@ -4,7 +4,7 @@
class TestCatalog(unittest.TestCase):
def _getTargetClass(self):
- from repoze.catalog.catalog import Catalog
+ from ..catalog import Catalog
return Catalog
def _makeOne(self, family=_marker):
@@ -16,13 +16,13 @@ def _makeOne(self, family=_marker):
def test_klass_provides_ICatalog(self):
klass = self._getTargetClass()
from zope.interface.verify import verifyClass
- from repoze.catalog.catalog import ICatalog
+ from ..catalog import ICatalog
verifyClass(ICatalog, klass)
def test_inst_provides_ICatalog(self):
klass = self._getTargetClass()
from zope.interface.verify import verifyObject
- from repoze.catalog.catalog import ICatalog
+ from ..catalog import ICatalog
inst = self._makeOne()
verifyObject(ICatalog, inst)
@@ -192,7 +192,7 @@ def test_search_with_sort_type(self):
c1 = IFSet([1, 2, 3, 4, 5])
idx1 = DummyIndex(c1)
catalog['name1'] = idx1
- from repoze.catalog.indexes.field import FWSCAN
+ from ..indexes.field import FWSCAN
numdocs, result = catalog.search(name1={}, sort_index='name1',
limit=1, sort_type=FWSCAN)
self.assertEqual(idx1.sort_type, FWSCAN)
@@ -209,10 +209,10 @@ def test_limited(self):
def _test_functional_merge(self, **extra):
catalog = self._makeOne()
- from repoze.catalog.indexes.field import CatalogFieldIndex
- from repoze.catalog.indexes.keyword import CatalogKeywordIndex
- from repoze.catalog.indexes.text import CatalogTextIndex
- from repoze.catalog.indexes.path2 import CatalogPathIndex2
+ from ..indexes.field import CatalogFieldIndex
+ from ..indexes.keyword import CatalogKeywordIndex
+ from ..indexes.text import CatalogTextIndex
+ from ..indexes.path2 import CatalogPathIndex2
class Content(object):
def __init__(self, field, keyword, text, path):
self.field = field
@@ -267,7 +267,7 @@ def test_functional_index_merge_ordered(self):
class TestFileStorageCatalogFactory(unittest.TestCase):
def _getTargetClass(self):
- from repoze.catalog.catalog import FileStorageCatalogFactory
+ from ..catalog import FileStorageCatalogFactory
return FileStorageCatalogFactory
def _makeOne(self, filename, appname, **kw):
@@ -284,14 +284,14 @@ def tearDown(self):
def test_no_conn_handler(self):
factory = self._makeOne(self.tempfile, 'catalog')
- from repoze.catalog.catalog import Catalog
+ from ..catalog import Catalog
catalog = factory()
self.failUnless(isinstance(catalog, Catalog))
factory.db.close()
def test_with_cache_size(self):
factory = self._makeOne(self.tempfile, 'catalog', cache_size=1000)
- from repoze.catalog.catalog import Catalog
+ from ..catalog import Catalog
catalog = factory()
self.failUnless(isinstance(catalog, Catalog))
self.assertEqual(factory.db._cache_size, 1000)
@@ -299,7 +299,7 @@ def test_with_cache_size(self):
def test_with_conn_handler(self):
factory = self._makeOne(self.tempfile, 'catalog')
- from repoze.catalog.catalog import Catalog
+ from ..catalog import Catalog
e = {}
def handle(conn):
e['conn'] = conn
@@ -310,7 +310,7 @@ def handle(conn):
class TestConnectionManager(unittest.TestCase):
def _getTargetClass(self):
- from repoze.catalog.catalog import ConnectionManager
+ from ..catalog import ConnectionManager
return ConnectionManager
def _makeOne(self):
@@ -353,7 +353,7 @@ class DummyTransaction:
def commit(self):
self.committed = True
-from repoze.catalog.catalog import ICatalogIndex
+from ..catalog import ICatalogIndex
from zope.interface import implements
class DummyIndex(object):
View
2  repoze/catalog/tests/test_document.py → hypatia/tests/test_document.py
@@ -2,7 +2,7 @@
class TestDocumentMap(unittest.TestCase):
def _getTargetClass(self):
- from repoze.catalog.document import DocumentMap
+ from ..document import DocumentMap
return DocumentMap
def _makeOne(self):
View
10 repoze/catalog/tests/test_functional.py → hypatia/tests/test_functional.py
@@ -1,13 +1,13 @@
import unittest
-from repoze.catalog import query as q
+from .. import query as q
class TestQueryBase(object):
def test_it(self):
- from repoze.catalog.catalog import Catalog
- from repoze.catalog.indexes.field import CatalogFieldIndex
- from repoze.catalog.indexes.keyword import CatalogKeywordIndex
- from repoze.catalog.indexes.text import CatalogTextIndex
+ from ..catalog import Catalog
+ from ..indexes.field import CatalogFieldIndex
+ from ..indexes.keyword import CatalogKeywordIndex
+ from ..indexes.text import CatalogTextIndex
catalog = Catalog()
catalog['name'] = CatalogFieldIndex('name')
View
4 repoze/catalog/tests/test_migration.py → hypatia/tests/test_migration.py
@@ -4,7 +4,7 @@
class TestMigration(unittest.TestCase):
def test_migrate_to_0_8_0(self):
- from repoze.catalog.migration import migrate_to_0_8_0
+ from ..migration import migrate_to_0_8_0
catalog = DummyCatalog()
migrate_to_0_8_0(catalog)
self.assertEqual(catalog['one'].migrated, set([1, 2, 3]))
@@ -13,7 +13,7 @@ def test_migrate_to_0_8_0(self):
def test_migrate_to_0_8_0_from_document_map(self):
- from repoze.catalog.migration import migrate_to_0_8_0_from_document_map
+ from ..migration import migrate_to_0_8_0_from_document_map
catalog = DummyCatalog()
migrate_to_0_8_0_from_document_map(catalog, catalog.document_map)
self.assertEqual(catalog['one'].migrated, set([2, 3, 4]))
View
232 repoze/catalog/tests/test_query.py → hypatia/tests/test_query.py
@@ -1,5 +1,5 @@
import unittest
-from repoze.catalog.query import ast_support
+from ..query import ast_support
class ComparatorTestBase(unittest.TestCase):
@@ -11,11 +11,11 @@ def _makeOne(self, index_name, value):
class TestQuery(unittest.TestCase):
def _makeOne(self):
- from repoze.catalog.query import Query as cls
+ from ..query import Query as cls
return cls()
def test_and(self):
- from repoze.catalog.query import And
+ from ..query import And
a = self._makeOne()
b = self._makeOne()
result = a & b
@@ -28,7 +28,7 @@ def test_and_type_error(self):
self.assertRaises(TypeError, a.__and__, 2)
def test_or(self):
- from repoze.catalog.query import Or
+ from ..query import Or
a = self._makeOne()
b = self._makeOne()
result = a | b
@@ -45,7 +45,7 @@ def test_iter_children(self):
self.assertEqual(a.iter_children(), ())
def test_print_tree(self):
- from repoze.catalog.query import Query
+ from ..query import Query
class Derived(Query):
@@ -74,7 +74,7 @@ def iter_children(self):
class TestComparator(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import Comparator
+ from ..query import Comparator
return Comparator
def test_ctor(self):
@@ -90,7 +90,7 @@ def test_eq(self):
class TestContains(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import Contains
+ from ..query import Contains
return Contains
def test_apply(self):
@@ -101,7 +101,7 @@ def test_apply(self):
self.assertEqual(catalog.index.contains, 'val')
def test_apply_w_name(self):
- from repoze.catalog.query import Name
+ from ..query import Name
catalog = DummyCatalog()
inst = self._makeOne('index', Name('foo'))
result = inst._apply(catalog, {'foo': 'val'})
@@ -109,7 +109,7 @@ def test_apply_w_name(self):
self.assertEqual(catalog.index.contains, 'val')
def test_apply_w_missing_name(self):
- from repoze.catalog.query import Name
+ from ..query import Name
catalog = DummyCatalog()
inst = self._makeOne('index', Name('foo'))
self.assertRaises(NameError, inst._apply, catalog, {})
@@ -119,7 +119,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "'val' in index")
def test_negate(self):
- from repoze.catalog.query import DoesNotContain
+ from ..query import DoesNotContain
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), DoesNotContain('index', 'val'))
@@ -127,7 +127,7 @@ def test_negate(self):
class TestDoesNotContain(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import DoesNotContain
+ from ..query import DoesNotContain
return DoesNotContain
def test_apply(self):
@@ -142,7 +142,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "'val' not in index")
def test_negate(self):
- from repoze.catalog.query import Contains
+ from ..query import Contains
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), Contains('index', 'val'))
@@ -150,7 +150,7 @@ def test_negate(self):
class TestEq(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import Eq
+ from ..query import Eq
return Eq
def test_apply(self):
@@ -165,7 +165,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "index == 'val'")
def test_negate(self):
- from repoze.catalog.query import NotEq
+ from ..query import NotEq
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), NotEq('index', 'val'))
@@ -173,7 +173,7 @@ def test_negate(self):
class TestNotEq(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import NotEq
+ from ..query import NotEq
return NotEq
def test_apply(self):
@@ -188,7 +188,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "index != 'val'")
def test_negate(self):
- from repoze.catalog.query import Eq
+ from ..query import Eq
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), Eq('index', 'val'))
@@ -196,7 +196,7 @@ def test_negate(self):
class TestGt(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import Gt
+ from ..query import Gt
return Gt
def test_apply(self):
@@ -211,7 +211,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "index > 'val'")
def test_negate(self):
- from repoze.catalog.query import Le
+ from ..query import Le
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), Le('index', 'val'))
@@ -219,7 +219,7 @@ def test_negate(self):
class TestLt(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import Lt
+ from ..query import Lt
return Lt
def test_apply(self):
@@ -234,7 +234,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "index < 'val'")
def test_negate(self):
- from repoze.catalog.query import Ge
+ from ..query import Ge
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), Ge('index', 'val'))
@@ -242,7 +242,7 @@ def test_negate(self):
class TestGe(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import Ge
+ from ..query import Ge
return Ge
def test_apply(self):
@@ -257,7 +257,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "index >= 'val'")
def test_negate(self):
- from repoze.catalog.query import Lt
+ from ..query import Lt
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), Lt('index', 'val'))
@@ -265,7 +265,7 @@ def test_negate(self):
class TestLe(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import Le
+ from ..query import Le
return Le
def test_apply(self):
@@ -280,7 +280,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "index <= 'val'")
def test_negate(self):
- from repoze.catalog.query import Gt
+ from ..query import Gt
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), Gt('index', 'val'))
@@ -288,7 +288,7 @@ def test_negate(self):
class TestAll(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import All
+ from ..query import All
return All
def test_apply(self):
@@ -303,7 +303,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "index in all([1, 2, 3])")
def test_negate(self):
- from repoze.catalog.query import NotAll
+ from ..query import NotAll
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), NotAll('index', 'val'))
@@ -311,7 +311,7 @@ def test_negate(self):
class TestNotAll(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import NotAll
+ from ..query import NotAll
return NotAll
def test_apply(self):
@@ -326,7 +326,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "index not in all([1, 2, 3])")
def test_negate(self):
- from repoze.catalog.query import All
+ from ..query import All
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), All('index', 'val'))
@@ -334,7 +334,7 @@ def test_negate(self):
class TestAny(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import Any
+ from ..query import Any
return Any
def test_apply(self):
@@ -359,7 +359,7 @@ def test_apply_with_tuple(self):
self.assertEqual(catalog.index.any, ('one', 'two'))
def test_apply_with_names(self):
- from repoze.catalog.query import Name
+ from ..query import Name
catalog = DummyCatalog()
inst = self._makeOne('index', [Name('foo'), Name('bar')])
result = inst._apply(catalog, names={'foo': 'one', 'bar': 'two'})
@@ -367,7 +367,7 @@ def test_apply_with_names(self):
self.assertEqual(catalog.index.any, ['one', 'two'])
def test_apply_with_names_in_tuple(self):
- from repoze.catalog.query import Name
+ from ..query import Name
catalog = DummyCatalog()
inst = self._makeOne('index', (Name('foo'), Name('bar')))
result = inst._apply(catalog, names={'foo': 'one', 'bar': 'two'})
@@ -379,7 +379,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "index in any([1, 2, 3])")
def test_negate(self):
- from repoze.catalog.query import NotAny
+ from ..query import NotAny
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), NotAny('index', 'val'))
@@ -387,7 +387,7 @@ def test_negate(self):
class TestNotAny(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import NotAny
+ from ..query import NotAny
return NotAny
def test_apply(self):
@@ -402,7 +402,7 @@ def test_to_str(self):
self.assertEqual(str(inst), "index not in any([1, 2, 3])")
def test_negate(self):
- from repoze.catalog.query import Any
+ from ..query import Any
inst = self._makeOne('index', 'val')
self.assertEqual(inst.negate(), Any('index', 'val'))
@@ -410,7 +410,7 @@ def test_negate(self):
class TestInRange(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import InRange
+ from ..query import InRange
return InRange
def _makeOne(self, index, begin, end,
@@ -427,7 +427,7 @@ def test_apply(self):
catalog.index.range, ('begin', 'end', False, False))
def test_apply_w_names(self):
- from repoze.catalog.query import Name
+ from ..query import Name
catalog = DummyCatalog()
inst = self._makeOne('index', Name('foo'), Name('bar'))
result = inst._apply(catalog, {'foo': 'begin', 'bar': 'end'})
@@ -436,7 +436,7 @@ def test_apply_w_names(self):
catalog.index.range, ('begin', 'end', False, False))
def test_apply_w_names_missing(self):
- from repoze.catalog.query import Name
+ from ..query import Name
catalog = DummyCatalog()
inst = self._makeOne('index', Name('foo'), Name('bar'))
self.assertRaises(NameError, inst._apply, catalog, {})
@@ -459,23 +459,23 @@ def test_to_str_exclusive(self):
self.assertEqual(str(inst), "0 < index < 5")
def test_from_gtlt(self):
- from repoze.catalog.query import Ge
- from repoze.catalog.query import Le
+ from ..query import Ge
+ from ..query import Le
gt = Ge('index', 0)
lt = Le('index', 5)
inst = self._getTargetClass().fromGTLT(gt, lt)
self.assertEqual(str(inst), "0 <= index <= 5")
def test_from_gtlt_exclusive(self):
- from repoze.catalog.query import Gt
- from repoze.catalog.query import Lt
+ from ..query import Gt
+ from ..query import Lt
gt = Gt('index', 0)
lt = Lt('index', 5)
inst = self._getTargetClass().fromGTLT(gt, lt)
self.assertEqual(str(inst), "0 < index < 5")
def test_negate(self):
- from repoze.catalog.query import NotInRange
+ from ..query import NotInRange
inst = self._makeOne('index', 'begin', 'end')
self.assertEqual(inst.negate(), NotInRange('index', 'begin', 'end'))
@@ -487,7 +487,7 @@ def test_not_equal_to_another_type(self):
class TestNotInRange(ComparatorTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import NotInRange
+ from ..query import NotInRange
return NotInRange
def _makeOne(self, index, begin, end,
@@ -520,7 +520,7 @@ def test_to_str_exclusive(self):
self.assertEqual(str(inst), "not(0 < index < 5)")
def test_negate(self):
- from repoze.catalog.query import InRange
+ from ..query import InRange
inst = self._makeOne('index', 'begin', 'end')
self.assertEqual(inst.negate(), InRange('index', 'begin', 'end'))
@@ -538,7 +538,7 @@ def _makeOne(self, left, right):
class TestBoolOp(BoolOpTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import BoolOp as cls
+ from ..query import BoolOp as cls
return cls
def test_iter_children(self):
@@ -554,7 +554,7 @@ class Dummy(object):
class TestOr(BoolOpTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import Or as cls
+ from ..query import Or as cls
return cls
def test_to_str(self):
@@ -592,7 +592,7 @@ def test_apply_right_empty(self):
self.assertEqual(o.family.union, None)
def test_negate(self):
- from repoze.catalog.query import And
+ from ..query import And
left = DummyQuery('foo')
right = DummyQuery('bar')
o = self._makeOne(left, right)
@@ -606,7 +606,7 @@ def test_negate(self):
class TestAnd(BoolOpTestBase):
def _getTargetClass(self):
- from repoze.catalog.query import And as cls
+ from ..query import And as cls
return cls
def test_to_str(self):
@@ -644,7 +644,7 @@ def test_apply_right_empty(self):
self.assertEqual(o.family.intersection, None)
def test_negate(self):
- from repoze.catalog.query import Or
+ from ..query import Or
left = DummyQuery('foo')
right = DummyQuery('bar')
o = self._makeOne(left, right)
@@ -658,7 +658,7 @@ def test_negate(self):
class TestNot(BoolOpTestBase):
def _makeOne(self, query):
- from repoze.catalog.query import Not as cls
+ from ..query import Not as cls
return cls(query)
def test_to_str(self):
@@ -686,7 +686,7 @@ def test_iter_children(self):
class TestName(unittest.TestCase):
def _makeOne(self):
- from repoze.catalog.query import Name as cls
+ from ..query import Name as cls
return cls('foo')
def test_to_str(self):
@@ -704,11 +704,11 @@ def test_eq(self):
class Test_parse_query(unittest.TestCase):
def tearDown(self):
- from repoze.catalog import query
+ from .. import query
query.ast_support = True
def _call_fut(self, expr):
- from repoze.catalog.query import parse_query as fut
+ from ..query import parse_query as fut
return fut(expr)
def test_not_an_expression(self):
@@ -742,7 +742,7 @@ def test_wrong_number_or_args_for_any(self):
self.assertRaises(ValueError, self._call_fut, 'a in any(1, 2)')
def test_no_ast_support(self):
- from repoze.catalog import query
+ from .. import query
query.ast_support = False
self.assertRaises(NotImplementedError, self._call_fut, None)
@@ -760,7 +760,7 @@ def test_list(self):
self.assertEqual(self._call_fut('[1, 2, 3]'), [1, 2, 3])
def test_tuple(self):
- from repoze.catalog.query import Name
+ from ..query import Name
self.assertEqual(self._call_fut('(a, b, c)'),
(Name('a'), Name('b'), Name('c')))
@@ -771,64 +771,64 @@ def test_dotted_names(self):
self.assertEqual(self._call_fut('a.foo.bar').id, 'a.foo.bar')
def test_eq(self):
- from repoze.catalog.query import Eq
+ from ..query import Eq
eq = self._call_fut('a.foo == 1')
self.failUnless(isinstance(eq, Eq))
self.assertEqual(eq.index_name, 'a.foo')
self.assertEqual(eq._value, 1)
def test_not_eq(self):
- from repoze.catalog.query import NotEq
+ from ..query import NotEq
not_eq = self._call_fut("a != 'one'")
self.failUnless(isinstance(not_eq, NotEq))
self.assertEqual(not_eq.index_name, 'a')
self.assertEqual(not_eq._value, "one")
def test_lt(self):
- from repoze.catalog.query import Lt
- from repoze.catalog.query import Name
+ from ..query import Lt
+ from ..query import Name
lt = self._call_fut("a < foo")
self.failUnless(isinstance(lt, Lt))
self.assertEqual(lt.index_name, 'a')
self.assertEqual(lt._value, Name('foo'))
def test_le(self):
- from repoze.catalog.query import Le
+ from ..query import Le
le = self._call_fut("a <= 4")
self.failUnless(isinstance(le, Le))
self.assertEqual(le.index_name, 'a')
self.assertEqual(le._value, 4)
def test_gt(self):
- from repoze.catalog.query import Gt
+ from ..query import Gt
gt = self._call_fut('b > 2')
self.failUnless(isinstance(gt, Gt))
self.assertEqual(gt.index_name, 'b')
self.assertEqual(gt._value, 2)
def test_ge(self):
- from repoze.catalog.query import Ge
+ from ..query import Ge
ge = self._call_fut("a >= 5")
self.failUnless(isinstance(ge, Ge))
self.assertEqual(ge.index_name, 'a')
self.assertEqual(ge._value, 5)
def test_contains(self):
- from repoze.catalog.query import Contains
+ from ..query import Contains
contains = self._call_fut("6 in a")
self.failUnless(isinstance(contains, Contains))
self.assertEqual(contains.index_name, 'a')
self.assertEqual(contains._value, 6)
def test_does_not_contain(self):
- from repoze.catalog.query import DoesNotContain
+ from ..query import DoesNotContain
contains = self._call_fut("6 not in a")
self.failUnless(isinstance(contains, DoesNotContain))
self.assertEqual(contains.index_name, 'a')
self.assertEqual(contains._value, 6)
def test_range_exclusive_exclusive(self):
- from repoze.catalog.query import InRange
+ from ..query import InRange
comp = self._call_fut("0 < a < 5")
self.failUnless(isinstance(comp, InRange))
self.assertEqual(comp.index_name, 'a')
@@ -838,7 +838,7 @@ def test_range_exclusive_exclusive(self):
self.failUnless(comp.end_exclusive)
def test_range_exclusive_inclusive(self):
- from repoze.catalog.query import InRange
+ from ..query import InRange
comp = self._call_fut("0 < a <= 5")
self.failUnless(isinstance(comp, InRange))
self.assertEqual(comp.index_name, 'a')
@@ -848,7 +848,7 @@ def test_range_exclusive_inclusive(self):
self.failIf(comp.end_exclusive)
def test_range_inclusive_exclusive(self):
- from repoze.catalog.query import InRange
+ from ..query import InRange
comp = self._call_fut("0 <= a < 5")
self.failUnless(isinstance(comp, InRange))
self.assertEqual(comp.index_name, 'a')
@@ -858,7 +858,7 @@ def test_range_inclusive_exclusive(self):
self.failUnless(comp.end_exclusive)
def test_range_inclusive_inclusive(self):
- from repoze.catalog.query import InRange
+ from ..query import InRange
comp = self._call_fut("0 <= a <= 5")
self.failUnless(isinstance(comp, InRange))
self.assertEqual(comp.index_name, 'a')
@@ -868,7 +868,7 @@ def test_range_inclusive_inclusive(self):
self.failIf(comp.end_exclusive)
def test_not_in_range(self):
- from repoze.catalog.query import NotInRange
+ from ..query import NotInRange
comp = self._call_fut("not(0 < a < 5)")
self.failUnless(isinstance(comp, NotInRange))
self.assertEqual(comp.index_name, 'a')
@@ -878,8 +878,8 @@ def test_not_in_range(self):
self.failUnless(comp.end_exclusive)
def test_or(self):
- from repoze.catalog.query import Eq
- from repoze.catalog.query import Or
+ from ..query import Eq
+ from ..query import Or
op = self._call_fut("(a == 1) | (b == 2)")
self.failUnless(isinstance(op, Or))
query = op.queries[0]
@@ -892,8 +892,8 @@ def test_or(self):
self.assertEqual(query._value, 2)
def test_or_with_bool_syntax(self):
- from repoze.catalog.query import NotEq
- from repoze.catalog.query import Or
+ from ..query import NotEq
+ from ..query import Or
op = self._call_fut("a != 1 or b != 2")
self.failUnless(isinstance(op, Or))
query = op.queries[0]
@@ -906,52 +906,52 @@ def test_or_with_bool_syntax(self):
self.assertEqual(query._value, 2)
def test_any(self):
- from repoze.catalog.query import Any
+ from ..query import Any
op = self._call_fut("a == 1 or a == 2 or a == 3")
self.failUnless(isinstance(op, Any), op)
self.assertEqual(op.index_name, 'a')
self.assertEqual(op._value, [1, 2, 3])
def test_better_any(self):
- from repoze.catalog.query import Any
+ from ..query import Any
op = self._call_fut("a in any([1, 2, 3])")
self.failUnless(isinstance(op, Any), op)
self.assertEqual(op.index_name, 'a')
self.assertEqual(op._value, [1, 2, 3])
def test_any_with_name(self):
- from repoze.catalog.query import Any
- from repoze.catalog.query import Name
+ from ..query import Any
+ from ..query import Name
op = self._call_fut("a in any(foo)")
self.failUnless(isinstance(op, Any), op)
self.assertEqual(op.index_name, 'a')
self.assertEqual(op._value, Name('foo'))
def test_any_with_names(self):
- from repoze.catalog.query import Any
- from repoze.catalog.query import Name
+ from ..query import Any
+ from ..query import Name
op = self._call_fut("a in any([foo, bar])")
self.failUnless(isinstance(op, Any), op)
self.assertEqual(op.index_name, 'a')
self.assertEqual(op._value, [Name('foo'), Name('bar')])
def test_not_any(self):
- from repoze.catalog.query import NotAny
+ from ..query import NotAny
op = self._call_fut("not(a == 1 or a == 2 or a == 3)")
self.failUnless(isinstance(op, NotAny), op)
self.assertEqual(op.index_name, 'a')
self.assertEqual(op._value, [1, 2, 3])
def test_better_not_any(self):
- from repoze.catalog.query import NotAny
+ from ..query import NotAny
op = self._call_fut("a not in any([1, 2, 3])")
self.failUnless(isinstance(op, NotAny), op)
self.assertEqual(op.index_name, 'a')
self.assertEqual(op._value, [1, 2, 3])
def test_and(self):
- from repoze.catalog.query import Eq
- from repoze.catalog.query import And
+ from ..query import Eq
+ from ..query import And
op = self._call_fut("(a == 1) & (b == 2)")
self.failUnless(isinstance(op, And))
query = op.queries[0]
@@ -964,8 +964,8 @@ def test_and(self):
self.assertEqual(query._value, 2)
def test_and_with_bool_syntax(self):
- from repoze.catalog.query import Eq
- from repoze.catalog.query import And
+ from ..query import Eq
+ from ..query import And
op = self._call_fut("a == 1 and b == 2")
self.failUnless(isinstance(op, And))
query = op.queries[0]
@@ -978,28 +978,28 @@ def test_and_with_bool_syntax(self):
self.assertEqual(query._value, 2)
def test_all(self):
- from repoze.catalog.query import All
+ from ..query import All
op = self._call_fut("a == 1 and a == 2 and a == 3")
self.failUnless(isinstance(op, All), op)
self.assertEqual(op.index_name, 'a')
self.assertEqual(op._value, [1, 2, 3])
def test_better_all(self):
- from repoze.catalog.query import All
+ from ..query import All
op = self._call_fut("a in all([1, 2, 3])")
self.failUnless(isinstance(op, All), op)
self.assertEqual(op.index_name, 'a')
self.assertEqual(op._value, [1, 2, 3])
def test_not_all(self):
- from repoze.catalog.query import NotAll
+ from ..query import NotAll
op = self._call_fut("not(a == 1 and a == 2 and a == 3)")
self.failUnless(isinstance(op, NotAll), op)
self.assertEqual(op.index_name, 'a')
self.assertEqual(op._value, [1, 2, 3])
def test_better_not_all(self):
- from repoze.catalog.query import NotAll
+ from ..query import NotAll
op = self._call_fut("a not in all([1, 2, 3])")
self.failUnless(isinstance(op, NotAll), op)
self.assertEqual(op.index_name, 'a')
@@ -1010,9 +1010,9 @@ def test_all_with_or(self):
# a == 1 or a == 2 and a == 3
# was transformed into:
# a any [1, 2, 3]
- from repoze.catalog.query import All
- from repoze.catalog.query import Eq
- from repoze.catalog.query import Or
+ from ..query import All
+ from ..query import Eq
+ from ..query import Or
op = self._call_fut("a == 1 or a == 2 and a == 3")
self.failUnless(isinstance(op, Or))
self.failUnless(isinstance(op.queries[0], Eq))
@@ -1021,7 +1021,7 @@ def test_all_with_or(self):
self.assertEqual(op.queries[1]._value, [2, 3])
def test_convert_gtlt_to_range(self):
- from repoze.catalog.query import InRange
+ from ..query import InRange
op = self._call_fut("a < 1 and a > 0")
self.failUnless(isinstance(op, InRange))
self.assertEqual(op._start, 0)
@@ -1030,7 +1030,7 @@ def test_convert_gtlt_to_range(self):
self.assertEqual(op.end_exclusive, True)
def test_convert_ltgt_to_range(self):
- from repoze.catalog.query import InRange
+ from ..query import InRange
op = self._call_fut("a > 0 and a < 1")
self.failUnless(isinstance(op, InRange))
self.assertEqual(op._start, 0)
@@ -1039,7 +1039,7 @@ def test_convert_ltgt_to_range(self):
self.assertEqual(op.end_exclusive, True)
def test_convert_gtlt_to_not_in_range(self):
- from repoze.catalog.query import NotInRange
+ from ..query import NotInRange
op = self._call_fut("a < 0 or a > 1")
self.failUnless(isinstance(op, NotInRange))
self.assertEqual(op._start, 0)
@@ -1048,7 +1048,7 @@ def test_convert_gtlt_to_not_in_range(self):
self.assertEqual(op.end_exclusive, False)
def test_convert_ltgt_to_not_in_range(self):
- from repoze.catalog.query import NotInRange
+ from ..query import NotInRange
op = self._call_fut("a > 1 or a < 0")
self.failUnless(isinstance(op, NotInRange))
self.assertEqual(op._start, 0)
@@ -1057,28 +1057,28 @@ def test_convert_ltgt_to_not_in_range(self):
self.assertEqual(op.end_exclusive, False)
def test_convert_gtlt_child_left_nephew_left(self):
- from repoze.catalog.query import Eq
- from repoze.catalog.query import And
- from repoze.catalog.query import InRange
+ from ..query import Eq
+ from ..query import And
+ from ..query import InRange
op = self._call_fut("a > 0 and (a < 5 and b == 7)")
self.failUnless(isinstance(op, And))
self.failUnless(isinstance(op.queries[0], InRange))
self.failUnless(isinstance(op.queries[1], Eq))
def test_strange_gtlt_child_left_nephew_right(self):
- from repoze.catalog.query import Eq
- from repoze.catalog.query import And
- from repoze.catalog.query import InRange
+ from ..query import Eq
+ from ..query import And
+ from ..query import InRange
op = self._call_fut("a > 0 and (b == 7 and a < 5)")
self.failUnless(isinstance(op, And))
self.failUnless(isinstance(op.queries[0], InRange))
self.failUnless(isinstance(op.queries[1], Eq))
def test_convert_gtlt_child_right_nephew_left(self):
- from repoze.catalog.query import Eq
- from repoze.catalog.query import Gt
- from repoze.catalog.query import And
- from repoze.catalog.query import InRange
+ from ..query import Eq
+ from ..query import Gt
+ from ..query import And
+ from ..query import InRange
op = self._call_fut("a >= -1 and b == 2 and c > 3 and a <= 1")
self.failUnless(isinstance(op, And))
self.failUnless(isinstance(op.queries[0], InRange))
@@ -1086,10 +1086,10 @@ def test_convert_gtlt_child_right_nephew_left(self):
self.failUnless(isinstance(op.queries[2], Gt))
def test_convert_gtlt_both_descendants(self):
- from repoze.catalog.query import Eq
- from repoze.catalog.query import Gt
- from repoze.catalog.query import And
- from repoze.catalog.query import InRange
+ from ..query import Eq
+ from ..query import Gt
+ from ..query import And
+ from ..query import InRange
op = self._call_fut("b == 2 and a > -1 and (a <= 1 and c > 3)")
self.failUnless(isinstance(op, And))
self.failUnless(isinstance(op.queries[0], Eq))
@@ -1097,8 +1097,8 @@ def test_convert_gtlt_both_descendants(self):
self.failUnless(isinstance(op.queries[2], Gt))
def test_convert_gtlt_both_descendants_multiple_times(self):
- from repoze.catalog.query import And
- from repoze.catalog.query import InRange
+ from ..query import And
+ from ..query import InRange
op = self._call_fut(
"(a > 0 and b > 0 and c > 0) and (a < 5 and b < 5 and c < 5)")
self.failUnless(isinstance(op, And))
@@ -1107,10 +1107,10 @@ def test_convert_gtlt_both_descendants_multiple_times(self):
self.failUnless(isinstance(op.queries[2], InRange))
def test_dont_convert_gtlt_to_range_with_or_spread_out(self):
- from repoze.catalog.query import Gt
- from repoze.catalog.query import Lt
- from repoze.catalog.query import And
- from repoze.catalog.query import Or
+ from ..query import Gt
+ from ..query import Lt
+ from ..query import And
+ from ..query import Or
op = self._call_fut("a > 0 and b > 0 or a < 5 and b < 5")
self.failUnless(isinstance(op, Or))
self.failUnless(isinstance(op.queries[0], And))
View
1  repoze/__init__.py
@@ -1 +0,0 @@
-__import__('pkg_resources').declare_namespace(__name__)
View
8 setup.cfg
@@ -1,10 +1,10 @@
[nosetests]
match=^test
-where=repoze/catalog
+where=hypatia
nocapture=1
cover-erase=1
-cover-package=repoze.catalog
+cover-package=hypatia
[aliases]
-dev = develop easy_install repoze.catalog[testing]
-docs = develop easy_install repoze.catalog[docs]
+dev = develop easy_install hypatia[testing]
+docs = develop easy_install hypatia[docs]
View
19 setup.py
@@ -12,7 +12,7 @@
#
##############################################################################
-__version__ = '0.8.2'
+__version__ = '0.0'
import os
@@ -30,9 +30,9 @@
testing_extras = ['nose', 'coverage']
docs_extras = ['Sphinx']
-setup(name='repoze.catalog',
+setup(name='hypatia',
version=__version__,
- description='Searching and indexing based on zope.index',
+ description='Python package for searching and indexing',
long_description=README + '\n\n' + CHANGES,
classifiers=[
"Intended Audience :: Developers",
@@ -43,13 +43,12 @@
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
],
keywords='indexing catalog search',
- author="Agendaless Consulting",
- author_email="repoze-dev@lists.repoze.org",
- url="http://www.repoze.org",
+ author="Chris McDonough, Agendaless Consulting",
+ author_email="pylons-discuss@googlegroups.com",
+ url="http://pylonsproject.org",
license="BSD-derived (http://www.repoze.org/LICENSE.txt)",
packages=find_packages(),
include_package_data=True,
- namespace_packages=['repoze'],
zip_safe=False,
tests_require = install_requires,
install_requires = install_requires,
@@ -58,11 +57,11 @@
'testing': testing_extras,
'docs':docs_extras,
},
- test_suite="repoze.catalog",
+ test_suite="hypatia",
## entry_points = """\
## [console_scripts]
- ## catalog_benchmark = repoze.catalog.benchmark.benchmark:run
- ## sortbench = repoze.catalog.benchmark.sortbench:main
+ ## catalog_benchmark = hypatia.benchmark.benchmark:run
+ ## sortbench = hypatia.benchmark.sortbench:main
## """,
)
Please sign in to comment.
Something went wrong with that request. Please try again.