From 8f640edc1e6db8615431210a2ae34abbc99f09e7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 3 Jul 2017 19:40:01 +0530 Subject: [PATCH] pep8 --- src/calibre/gui2/dialogs/quickview.py | 13 ++++++------- src/calibre/gui2/preferences/look_feel.py | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/calibre/gui2/dialogs/quickview.py b/src/calibre/gui2/dialogs/quickview.py index e81d86d43f..8b7f5141d7 100644 --- a/src/calibre/gui2/dialogs/quickview.py +++ b/src/calibre/gui2/dialogs/quickview.py @@ -45,6 +45,7 @@ class TableItem(QTableWidgetItem): return self.sort_idx < other.sort_idx return 0 + IN_WIDGET_ITEMS = 0 IN_WIDGET_BOOKS = 1 IN_WIDGET_LOCK = 2 @@ -134,9 +135,9 @@ class Quickview(QDialog, Ui_Quickview): self.db = self.view.model().db self.gui = gui self.is_closed = False - self.current_book_id = None # the db id of the book used to fill the lh pane - self.current_column = None # current logical column in books list - self.current_key = None # current lookup key in books list + self.current_book_id = None # the db id of the book used to fill the lh pane + self.current_column = None # current logical column in books list + self.current_key = None # current lookup key in books list self.last_search = None self.no_valid_items = False @@ -322,7 +323,6 @@ class Quickview(QDialog, Ui_Quickview): if self.last_search is not None: self.gui.search.set_search_string(self.last_search) - def book_was_changed(self, mi): ''' Called when book information is changed in the library view. Make that @@ -580,6 +580,7 @@ class Quickview(QDialog, Ui_Quickview): self._close() QDialog.reject(self) + def get_qv_field_list(fm, use_defaults=False): from calibre.gui2.ui import get_gui db = get_gui().current_db @@ -590,9 +591,7 @@ def get_qv_field_list(fm, use_defaults=False): fieldlist = list(src['qv_display_fields']) names = frozenset([x[0] for x in fieldlist]) for field in fm.displayable_field_keys(): - if (field != 'comments' - and fm[field]['datatype'] != 'comments' - and field not in names): + if (field != 'comments' and fm[field]['datatype'] != 'comments' and field not in names): fieldlist.append((field, False)) available = frozenset(fm.displayable_field_keys()) return [(f, d) for f, d in fieldlist if f in available] diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index 081f176be7..bc238796b2 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -211,6 +211,7 @@ class IdLinksEditor(Dialog): self.table.removeRow(r) # }}} + class DisplayedFields(QAbstractListModel): # {{{ def __init__(self, db, parent=None): @@ -388,7 +389,6 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): r('qv_retkey_changes_column', gprefs) r('qv_show_on_startup', gprefs) - r('cover_flow_queue_length', config, restart_required=True) r('cover_browser_reflections', gprefs) r('cover_browser_title_template', db.prefs) @@ -644,7 +644,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): self.changed_signal.emit() self.update_font_display() self.display_model.restore_defaults() - self.qv_display_model.restore_defaults(); + self.qv_display_model.restore_defaults() self.edit_rules.clear() self.icon_rules.clear() self.grid_rules.clear()