Commit graph

11 commits

Author SHA1 Message Date
Adrian Sampson
f474f3aed2 split FieldQuery into base and registered versions 2013-03-14 10:00:30 -07:00
Adrian Sampson
f005ec2de0 refactor: everything is like a plugin query (#214)
The initial idea for this refactor was motivated by the need to make
PluginQuery.match() have the same method signature as the match() methods on
other queries. That is, it needed to take an *item*, not the pattern and
value. (The pattern is supplied when the query is constructed.) So it made
sense to move the value-to-pattern code to a class method.

But then I realized that all the other FieldQuery subclasses needed to do
essentially the same thing. So I eliminated PluginQuery altogether and
refactored FieldQuery to subsume its functionality. I then changed all the
other FieldQuery subclasses to conform to the same pattern.

This has the side effect of allowing different kinds of queries (even
non-field queries) down the road.
2013-03-13 22:57:20 -07:00
Adrian Sampson
40b49ac786 some low-level tweaks to extensible queries (#214) 2013-03-13 21:59:03 -07:00
Philippe Mongeau
8b1511a8af fix fuzzy config 2013-03-10 20:39:02 -04:00
Philippe Mongeau
ca8af62e9c change queries() function to returns a dict
of {prefix: PluginQuery}

use the class __name__ as sqlite function name

make RegexpQuery use the AnyPluginQuery
2013-03-10 20:11:42 -04:00
Philippe Mongeau
2a42c75cba fuzzy: use smartcase for the pattern
ignore case unless the pattern contains a capital letter
2013-03-10 19:07:29 -04:00
Philippe Mongeau
7d879289c1 fuzzy: add prefix config 2013-03-10 18:00:28 -04:00
Philippe Mongeau
09156b03f0 fuzzy: use threshold value from config 2013-03-10 17:37:03 -04:00
Philippe Mongeau
7314bc0524 make fuzzy use PluginQuery instead of a subcommand 2013-03-10 16:50:54 -04:00
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson
51e9c519d4 plugin renames: fuzzy and random
Renamed fuzzy_search to fuzzy and rdm to random. These names should be easier
to remember since they are the same as the commands they provide.

--HG--
rename : beetsplug/fuzzy_search.py => beetsplug/fuzzy.py
rename : beetsplug/rdm.py => beetsplug/random.py
rename : docs/plugins/fuzzy_search.rst => docs/plugins/fuzzy.rst
rename : docs/plugins/rdm.rst => docs/plugins/random.rst
2012-12-23 14:46:20 -08:00
Renamed from beetsplug/fuzzy_search.py (Browse further)