mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
commit
d566f691bb
@ -19,8 +19,8 @@ If this module is run, it will perform a series of unit tests.
|
|||||||
import sys, string, operator
|
import sys, string, operator
|
||||||
|
|
||||||
from calibre.utils.pyparsing import CaselessKeyword, Group, Forward, \
|
from calibre.utils.pyparsing import CaselessKeyword, Group, Forward, \
|
||||||
CharsNotIn, Suppress, OneOrMore, MatchFirst, CaselessLiteral, \
|
CharsNotIn, Suppress, OneOrMore, MatchFirst, alphas, alphanums, \
|
||||||
Optional, NoMatch, ParseException, QuotedString, Word
|
Optional, ParseException, QuotedString, Word
|
||||||
from calibre.constants import preferred_encoding
|
from calibre.constants import preferred_encoding
|
||||||
from calibre.utils.icu import sort_key
|
from calibre.utils.icu import sort_key
|
||||||
|
|
||||||
@ -129,7 +129,8 @@ class SearchQueryParser(object):
|
|||||||
self.optimize = optimize
|
self.optimize = optimize
|
||||||
# Define a token
|
# Define a token
|
||||||
self.standard_locations = locations
|
self.standard_locations = locations
|
||||||
location = Optional(Word(string.ascii_letters+'#')+Suppress(':'), default='all')
|
location = Optional(Word(alphas+'#', bodyChars=alphanums+'_')+Suppress(':'),
|
||||||
|
default='all')
|
||||||
word_query = CharsNotIn(string.whitespace + '()')
|
word_query = CharsNotIn(string.whitespace + '()')
|
||||||
#quoted_query = Suppress('"')+CharsNotIn('"')+Suppress('"')
|
#quoted_query = Suppress('"')+CharsNotIn('"')+Suppress('"')
|
||||||
quoted_query = QuotedString('"', escChar='\\')
|
quoted_query = QuotedString('"', escChar='\\')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user