From 328f51c7ce480dbf3d2226a0e2920158b44d3e19 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 25 Apr 2015 12:16:24 +0530 Subject: [PATCH] ... --- src/calibre/library/coloring.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/library/coloring.py b/src/calibre/library/coloring.py index 671ef84771..ab8551b0d7 100644 --- a/src/calibre/library/coloring.py +++ b/src/calibre/library/coloring.py @@ -13,7 +13,7 @@ from textwrap import dedent color_row_key = '*row' -class Rule(object): # {{{ +class Rule(object): # {{{ SIGNATURE = '# BasicColorRule():' @@ -56,7 +56,7 @@ class Rule(object): # {{{ def template(self): if not self.color or not self.conditions: return None - conditions = map(self.apply_condition, self.conditions) + conditions = [x for x in map(self.apply_condition, self.conditions) if x is not None] conditions = (',\n' + ' '*9).join(conditions) return dedent('''\ program: @@ -248,4 +248,3 @@ def migrate_old_rule(fm, template): rules.append(r.template) return rules return [template] -