mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
Fixes #1918030 [Manage tags shows wrong count](https://bugs.launchpad.net/calibre/+bug/1918030)
This commit is contained in:
commit
c20c140b52
@ -217,7 +217,7 @@ General Program Mode replaces the template with a program written in the `templa
|
||||
top_expression ::= or_expression
|
||||
or_expression ::= and_expression [ '||' and_expression ]*
|
||||
and_expression ::= not_expression [ '&&' not_expression ]*
|
||||
not_expression ::= ['!' not_expression]* | compare_exp
|
||||
not_expression ::= [ '!' not_expression ]* | compare_exp
|
||||
compare_expr ::= add_sub_expr [ compare_op add_sub_expr ]
|
||||
compare_op ::= '==' | '!=' | '>=' | '>' | '<=' | '<' | 'in' |
|
||||
'==#' | '!=#' | '>=#' | '>#' | '<=#' | '<#'
|
||||
@ -227,13 +227,13 @@ General Program Mode replaces the template with a program written in the `templa
|
||||
times_div_op ::= '*' | '/'
|
||||
unary_op_expr ::= [ add_sub_op unary_op_expr ]* | expression
|
||||
expression ::= identifier | constant | function | assignment |
|
||||
if_expression | for_expression | '(' top_expression ')'
|
||||
if_expression | for_expression | '(' expression_list ')'
|
||||
identifier ::= sequence of letters or ``_`` characters
|
||||
constant ::= " string " | ' string ' | number
|
||||
function ::= identifier '(' top_expression [ ',' top_expression ]* ')'
|
||||
function ::= identifier '(' expression_list [ ',' expression_list ]* ')'
|
||||
assignment ::= identifier '=' top_expression
|
||||
if_expression ::= 'if' condition 'then' expression_list
|
||||
[elif_expression] ['else' expression_list] 'fi'
|
||||
[ elif_expression ] [ 'else' expression_list ] 'fi'
|
||||
condition ::= top_expression
|
||||
elif_expression ::= 'elif' condition 'then' expression_list elif_expression | ''
|
||||
for_expression ::= 'for' identifier 'in' list_expression
|
||||
|
@ -319,7 +319,7 @@ class TagListEditor(QDialog, Ui_TagListEditor):
|
||||
|
||||
def search_for_books(self, item):
|
||||
from calibre.gui2.ui import get_gui
|
||||
get_gui().search.set_search_string('{0}:"{1}"'.format(self.category,
|
||||
get_gui().search.set_search_string('{0}:"={1}"'.format(self.category,
|
||||
unicode_type(item.text()).replace(r'"', r'\"')))
|
||||
|
||||
qv = get_quickview_action_plugin()
|
||||
|
@ -568,7 +568,7 @@ class _Parser(object):
|
||||
def expr(self):
|
||||
if self.token_op_is_lparen():
|
||||
self.consume()
|
||||
rv = self.top_expr()
|
||||
rv = self.expression_list()
|
||||
if not self.token_op_is_rparen():
|
||||
self.error(_('Missing )'))
|
||||
self.consume()
|
||||
@ -598,7 +598,7 @@ class _Parser(object):
|
||||
arguments = list()
|
||||
while not self.token_op_is_rparen():
|
||||
# evaluate the expression (recursive call)
|
||||
arguments.append(self.top_expr())
|
||||
arguments.append(self.expression_list())
|
||||
if not self.token_op_is_comma():
|
||||
break
|
||||
self.consume()
|
||||
@ -906,6 +906,8 @@ class _Interpreter(object):
|
||||
|
||||
def expr(self, prog):
|
||||
try:
|
||||
if isinstance(prog, list):
|
||||
return self.expression_list(prog)
|
||||
return self.NODE_OPS[prog.node_type](self, prog)
|
||||
except ValueError as e:
|
||||
raise e
|
||||
|
Loading…
x
Reference in New Issue
Block a user