Commits

Matt Chaput committed cf9c7d5

Fixed PEP8 issues. Fixed docstrings. See issue #127.

Comments (0)

Files changed (8)

src/whoosh/query/qcore.py

         call this method using :meth:`Query.has_terms`.
 
         To get all terms in a query tree, use :meth:`Query.iter_all_terms`.
-
-        :param exreader: a reader to use to expand multiterm queries such as
-            prefixes and wildcards. The default is None meaning do not expand.
         """
 
         return iter(())
         [("title", "charlie")]
 
         :param phrases: Whether to add words found in Phrase queries.
-        :param expand: If True, queries that match multiple terms
-            (such as :class:`Wildcard` and :class:`Prefix`) will return all
-            matching expansions.
         """
 
         for q in self.leaves():

tests/test_classify.py

 from __future__ import with_statement
 
-from nose.tools import assert_equal  #@UnresolvedImport
+from nose.tools import assert_equal  # @UnresolvedImport
 
 from whoosh import analysis, classify, fields, formats
 from whoosh.compat import u, text_type

tests/test_codecs.py

                        d=u("rolling timing yelling"))
         w.add_document(a=u("charlie delta echo"), b=5.5, c=300,
                        d=u("using opening pulling"))
-        w.add_document(a=u("delta echo foxtrot"), b=True, c= -100,
+        w.add_document(a=u("delta echo foxtrot"), b=True, c=-100,
                        d=u("aching selling dipping"))
-        w.add_document(a=u("echo foxtrot india"), b=None, c= -200,
+        w.add_document(a=u("echo foxtrot india"), b=None, c=-200,
                        d=u("filling going hopping"))
 
     with ix.reader() as r:
                        d=u("rolling timing yelling"))
         w.add_document(a=u("charlie delta echo"), b=5.5, c=300,
                        d=u("using opening pulling"))
-        w.add_document(a=u("delta echo foxtrot"), b=True, c= -100,
+        w.add_document(a=u("delta echo foxtrot"), b=True, c=-100,
                        d=u("aching selling dipping"))
-        w.add_document(a=u("echo foxtrot india"), b=None, c= -200,
+        w.add_document(a=u("echo foxtrot india"), b=None, c=-200,
                        d=u("filling going hopping"))
 
     reader = codec.reader(schema)

tests/test_collector.py

 from __future__ import with_statement
 
-from nose.tools import assert_equal # @UnresolvedImport
+from nose.tools import assert_equal  # @UnresolvedImport
 
 from whoosh import fields, query
 from whoosh.compat import u

tests/test_dateparse.py

                  basedate + timedelta(seconds=20))
 
     assert_equal(rt.date_from("- 2 h", basedate),
-                 basedate + timedelta(hours= -2))
+                 basedate + timedelta(hours=-2))
     assert_equal(rt.date_from("- 25 minutes", basedate),
-                 basedate + timedelta(minutes= -25))
+                 basedate + timedelta(minutes=-25))
     assert_equal(rt.date_from("-400 secs", basedate),
-                 basedate + timedelta(seconds= -400))
+                 basedate + timedelta(seconds=-400))
 
     assert_equal(rt.date_from("+1hr 5m", basedate),
                  basedate + timedelta(hours=1, minutes=5))
     assert_equal(rt.date_from("-8hr 12m", basedate),
-                 basedate + timedelta(hours= -8, minutes= -12))
+                 basedate + timedelta(hours=-8, minutes=-12))
     assert_equal(rt.date_from("+1hr 5s", basedate),
                  basedate + timedelta(hours=1, seconds=5))
     assert_equal(rt.date_from("+1hr 12m 5s", basedate),
                  basedate + timedelta(hours=1, minutes=12, seconds=5))
     assert_equal(rt.date_from("-1hr 5s", basedate),
-                 basedate + timedelta(hours= -1, seconds= -5))
+                 basedate + timedelta(hours=-1, seconds=-5))
     assert_equal(rt.date_from("-1hr 12m 5s", basedate),
-                 basedate + timedelta(hours= -1, minutes= -12, seconds= -5))
+                 basedate + timedelta(hours=-1, minutes=-12, seconds=-5))
 
 
 def test_relative_days():
                  basedate + relativedelta(days=5))
 
     assert_equal(p.date_from("-6yr", basedate),
-                 basedate + relativedelta(years= -6))
+                 basedate + relativedelta(years=-6))
     assert_equal(p.date_from("- 7 mons", basedate),
-                 basedate + relativedelta(months= -7))
+                 basedate + relativedelta(months=-7))
     assert_equal(p.date_from("-8 wks", basedate),
-                 basedate + relativedelta(weeks= -8))
+                 basedate + relativedelta(weeks=-8))
     assert_equal(p.date_from("- 9 dy", basedate),
-                 basedate + relativedelta(days= -9))
+                 basedate + relativedelta(days=-9))
 
     assert_equal(p.date_from("+1y 12mo 400d", basedate),
                  basedate + relativedelta(years=1, months=12, days=400))
     assert_equal(p.date_from("-7mo 8d", basedate),
-                 basedate + relativedelta(months= -7, days= -8))
+                 basedate + relativedelta(months=-7, days=-8))
     assert_equal(p.date_from("+5wks 2d", basedate),
                  basedate + relativedelta(weeks=5, days=2))
     assert_equal(p.date_from("-1y 1w", basedate),
-                 basedate + relativedelta(years= -1, weeks= -1))
+                 basedate + relativedelta(years=-1, weeks=-1))
 
     assert_equal(p.date_from("+1y 2d 5h 12s", basedate),
                  basedate + relativedelta(years=1, days=2, hours=5,
                          dict(year=None, month=10, day=12))
 
     assert_datespan(p.date_from("-2d to +1w", basedate),
-                         basedate + relativedelta(days= -2),
+                         basedate + relativedelta(days=-2),
                          basedate + relativedelta(weeks=1))
 
 

tests/test_highlighting.py

 
 from __future__ import with_statement
 
-from nose.tools import assert_equal, assert_raises  #@UnresolvedImport
+from nose.tools import assert_equal, assert_raises  # @UnresolvedImport
 
 from whoosh import analysis, highlight, fields, qparser, query
 from whoosh.compat import u

tests/test_results.py

         assert_equal(r.pagenum, 2)
         assert_equal(r.pagelen, 2)
 
+
 def test_pages_with_filter():
     from whoosh.scoring import Frequency
 

tests/test_sorting.py

 
 
 docs = ({"id": u("zulu"), "num": 100, "tag": u("one"), "frac": 0.75},
-        {"id": u("xray"), "num":-5, "tag": u("three"), "frac": 2.0},
+        {"id": u("xray"), "num": -5, "tag": u("three"), "frac": 2.0},
         {"id": u("yankee"), "num": 3, "tag": u("two"), "frac": 5.5},
 
         {"id": u("alfa"), "num": 7, "tag": u("three"), "frac": 2.25},
         {"id": u("tango"), "num": 2, "tag": u("two"), "frac": 1.75},
-        {"id": u("foxtrot"), "num":-800, "tag": u("two"), "frac": 3.25},
+        {"id": u("foxtrot"), "num": -800, "tag": u("two"), "frac": 3.25},
 
         {"id": u("sierra"), "num": 1, "tag": u("one"), "frac": 4.75},
         {"id": u("whiskey"), "num": 0, "tag": u("three"), "frac": 5.25},