From 5738b0453ce6d15286489e4e7cd8858ad6064b32 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 3 Jun 2011 15:34:41 -0600 Subject: [PATCH 1/2] Escape color templates when redering rules list --- src/calibre/gui2/preferences/coloring.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/preferences/coloring.py b/src/calibre/gui2/preferences/coloring.py index 695adabed8..0fca30695b 100644 --- a/src/calibre/gui2/preferences/coloring.py +++ b/src/calibre/gui2/preferences/coloring.py @@ -12,6 +12,7 @@ from PyQt4.Qt import (QWidget, QDialog, QLabel, QGridLayout, QComboBox, QSize, QScrollArea, QPushButton, QVBoxLayout, QDialogButtonBox, QToolButton, QListView, QAbstractListModel, pyqtSignal, QSizePolicy, QSpacerItem) +from calibre import prepare_string_for_xml from calibre.utils.icu import sort_key from calibre.gui2 import error_dialog from calibre.gui2.dialogs.template_dialog import TemplateDialog @@ -430,7 +431,7 @@ class RulesModel(QAbstractListModel): # {{{ return _('''

Advanced Rule for column %s:

%s
- ''')%(col, rule) + ''')%(col, prepare_string_for_xml(rule)) conditions = [self.condition_to_html(c) for c in rule.conditions] return _('''\

Set the color of %s to %s if the following @@ -439,9 +440,10 @@ class RulesModel(QAbstractListModel): # {{{ ''') % (col, rule.color, ''.join(conditions)) def condition_to_html(self, condition): + c, a, v = condition return ( _('

  • If the %s column %s value: %s') % - tuple(condition)) + (c, a, prepare_string_for_xml(v))) # }}} From 66f98e8ee20dbcc3a228709bcd8b6a9aaf23fc90 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 3 Jun 2011 15:42:15 -0600 Subject: [PATCH 2/2] Nook TSR driver: Do not upload separate cover thumbnails --- src/calibre/devices/nook/driver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/devices/nook/driver.py b/src/calibre/devices/nook/driver.py index aaa68891ba..22264c3458 100644 --- a/src/calibre/devices/nook/driver.py +++ b/src/calibre/devices/nook/driver.py @@ -117,4 +117,6 @@ class NOOK_TSR(NOOK): EBOOK_DIR_MAIN = EBOOK_DIR_CARD_A = 'My Files/Books' WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = 'EBOOK_DISK' + def upload_cover(self, path, filename, metadata, filepath): + pass