From cd293a5f5b53bb13d31ef77b482548bf3664e1b3 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Jan 31 2017 20:19:49 +0000 Subject: Update to 0.4.1 --- diff --git a/.gitignore b/.gitignore index 51d8a18..517959a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /flask-whooshee-0.0.5.tar.gz /flask-whooshee-0.0.6.tar.gz /flask-whooshee-0.0.7.tar.gz +/flask-whooshee-0.4.1.tar.gz diff --git a/0001-add-tests-to-setup.patch b/0001-add-tests-to-setup.patch deleted file mode 100644 index cbdd163..0000000 --- a/0001-add-tests-to-setup.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up flask-whooshee-0.0.7/setup.py.orig flask-whooshee-0.0.7/setup.py ---- flask-whooshee-0.0.7/setup.py.orig 2015-09-02 15:02:39.740818811 +0200 -+++ flask-whooshee-0.0.7/setup.py 2015-09-02 15:03:25.787321899 +0200 -@@ -20,6 +20,7 @@ setup( - py_modules = ['flask_whooshee', ], - install_requires = open('requirements.txt').read().splitlines(), - setup_requires = [], -+ test_suite= 'test', - classifiers = ['Development Status :: 3 - Alpha', - 'Environment :: Web Environment', - 'Intended Audience :: Developers', diff --git a/auto_update.patch b/auto_update.patch new file mode 100644 index 0000000..a7b801e --- /dev/null +++ b/auto_update.patch @@ -0,0 +1,61 @@ +From 2f6f740610330b9541341ac5f4867c75639576ba Mon Sep 17 00:00:00 2001 +From: clime +Date: Tue, 19 Jul 2016 14:26:52 +0200 +Subject: [PATCH] auto_update class attribute added for AbstractWhoosheer + +Decides if a whoosheer should be updated by whooshee.on_commit method. +--- + flask_whooshee.py | 4 ++++ + test.py | 17 +++++++++++++++++ + 3 files changed, 39 insertions(+) + +diff --git a/flask_whooshee.py b/flask_whooshee.py +index 9367d21..b0d2bfb 100644 +--- a/flask_whooshee.py ++++ b/flask_whooshee.py +@@ -128,6 +128,8 @@ class AbstractWhoosheer(object): + searched. + """ + ++ auto_update = True ++ + @classmethod + def search(cls, search_string, values_of='', group=whoosh.qparser.OrGroup, match_substrings=True, limit=None): + """Searches the fields for given search_string. +@@ -395,6 +397,8 @@ def on_commit(self, changes): + to do the actual index writing. + """ + for wh in self.whoosheers: ++ if not wh.auto_update: ++ continue + writer = None + for change in changes: + if change[0].__class__ in wh.models: +diff --git a/test.py b/test.py +index 65ea79c..103866f 100644 +--- a/test.py ++++ b/test.py +@@ -117,6 +117,23 @@ def test_nothing_found(self): + found = self.Entry.query.whooshee_search('not there!').all() + self.assertEqual(len(found), 0) + ++ def test_no_autoupdate(self): ++ for whoosheer in self.wh.whoosheers: ++ whoosheer.auto_update = False ++ self.db.session.add(self.u1) ++ self.db.session.commit() ++ ++ found = self.Entry.query.whooshee_search('chuck').all() ++ self.assertEqual(len(found), 0) # nothing is found ++ ++ for whoosheer in self.wh.whoosheers: ++ whoosheer.auto_update = True ++ self.db.session.add(self.u2) ++ self.db.session.commit() ++ ++ found = self.Entry.query.whooshee_search('arnold').all() ++ self.assertEqual(len(found), 1) # arnold is found ++ + def test_mw_result_in_different_fields(self): + self.db.session.add_all(self.all_inst) + self.db.session.commit() diff --git a/python-flask-whooshee.spec b/python-flask-whooshee.spec index 4a5f22a..ff2e753 100644 --- a/python-flask-whooshee.spec +++ b/python-flask-whooshee.spec @@ -2,15 +2,15 @@ %global with_python3 1 Name: python-flask-whooshee -Version: 0.0.7 -Release: 5%{?dist} +Version: 0.4.1 +Release: 1%{?dist} Summary: Whoosh integration License: GPLv2+ URL: https://github.com/bkabrda/flask-whooshee Source0: https://pypi.python.org/packages/source/f/%{mod_name}/%{mod_name}-%{version}.tar.gz -# Adds test_suite line into setup.py -Patch1: 0001-add-tests-to-setup.patch +# https://github.com/bkabrda/flask-whooshee/pull/19 +Patch1: auto_update.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools @@ -51,7 +51,7 @@ Whoosh integration that allows to create and search custom indexes. %prep %setup -q -n %{mod_name}-%{version} -%patch1 -p1 +%autopatch %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} @@ -99,6 +99,9 @@ popd %changelog +* Tue Jan 31 2017 Robert Kuska - 0.4.1-1 +- Update to 0.4.1 + * Mon Dec 19 2016 Miro HronĨok - 0.0.7-5 - Rebuild for Python 3.6 diff --git a/sources b/sources index 17dfb70..b07dabd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -17aa5a8a6ac2b9b7be4659d2d421746b flask-whooshee-0.0.7.tar.gz +SHA512 (flask-whooshee-0.4.1.tar.gz) = 4d74a721687261edd12613b0f9b186b195119ababc12d7aa8875a96493c874da83dbcc7e0261710aaff5a9cc57a2424763046196b8cb8b08f25d93f2ff9f7330