From e1072478cb87fdaf9fe7141f209307b34f43fb5d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 20 Jan 2025 20:50:29 +0530 Subject: [PATCH] pep8 --- src/calibre/gui2/preferences/__init__.py | 1 - src/calibre/gui2/preferences/look_feel_tabs/__init__.py | 3 ++- src/calibre/gui2/preferences/look_feel_tabs/cover_view.py | 2 -- src/calibre/gui2/preferences/look_feel_tabs/tb_hierarchy.py | 5 +++-- src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py | 3 ++- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/calibre/gui2/preferences/__init__.py b/src/calibre/gui2/preferences/__init__.py index 17c95573b8..c56e2c0b21 100644 --- a/src/calibre/gui2/preferences/__init__.py +++ b/src/calibre/gui2/preferences/__init__.py @@ -20,7 +20,6 @@ from qt.core import ( QListView, QListWidget, Qt, - QTabWidget, QTableWidget, QVBoxLayout, QWidget, diff --git a/src/calibre/gui2/preferences/look_feel_tabs/__init__.py b/src/calibre/gui2/preferences/look_feel_tabs/__init__.py index c9d1b4f730..6cae188d2a 100644 --- a/src/calibre/gui2/preferences/look_feel_tabs/__init__.py +++ b/src/calibre/gui2/preferences/look_feel_tabs/__init__.py @@ -10,6 +10,7 @@ from qt.core import QAbstractListModel, QIcon, QItemSelectionModel, Qt from calibre.gui2.book_details import get_field_list + class DisplayedFields(QAbstractListModel): # {{{ def __init__(self, db, parent=None, pref_name=None, category_icons=None): @@ -119,4 +120,4 @@ def move_field_down(widget, model): sm.select(idx, QItemSelectionModel.SelectionFlag.ClearAndSelect) widget.setCurrentIndex(idx) -# }}} \ No newline at end of file +# }}} diff --git a/src/calibre/gui2/preferences/look_feel_tabs/cover_view.py b/src/calibre/gui2/preferences/look_feel_tabs/cover_view.py index 57f4936d24..bbe4d18a4b 100644 --- a/src/calibre/gui2/preferences/look_feel_tabs/cover_view.py +++ b/src/calibre/gui2/preferences/look_feel_tabs/cover_view.py @@ -9,7 +9,6 @@ __docformat__ = 'restructuredtext en' from qt.core import QKeySequence from calibre.gui2 import config, gprefs - from calibre.gui2.dialogs.template_dialog import TemplateDialog from calibre.gui2.preferences import ConfigTabWidget, ConfigWidgetBase, set_help_tips from calibre.gui2.preferences.look_feel_tabs.cover_view_ui import Ui_Form @@ -63,4 +62,3 @@ class CoverView(ConfigTabWidget, Ui_Form): gui.cover_flow.setActivateOnDoubleClick(gprefs['cb_double_click_to_activate']) gui.update_cover_flow_subtitle_font() gui.cover_flow.template_inited = False - diff --git a/src/calibre/gui2/preferences/look_feel_tabs/tb_hierarchy.py b/src/calibre/gui2/preferences/look_feel_tabs/tb_hierarchy.py index aaa49e07f1..2f31825daa 100644 --- a/src/calibre/gui2/preferences/look_feel_tabs/tb_hierarchy.py +++ b/src/calibre/gui2/preferences/look_feel_tabs/tb_hierarchy.py @@ -5,8 +5,8 @@ __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal ' __docformat__ = 'restructuredtext en' -from functools import partial import json +from functools import partial from qt.core import QListWidgetItem, Qt @@ -15,6 +15,7 @@ from calibre.gui2.preferences import ConfigTabWidget from calibre.gui2.preferences.look_feel_tabs import DisplayedFields from calibre.gui2.preferences.look_feel_tabs.tb_hierarchy_ui import Ui_Form + class TBHierarchicalFields(DisplayedFields): # {{{ # The code in this class depends on the fact that the tag browser is # initialized before this class is instantiated. @@ -170,4 +171,4 @@ class TbHierarchyTab(ConfigTabWidget, Ui_Form): def commit(self): self.tb_search_order_commit() - self.tb_hierarchical_cats_model.commit() \ No newline at end of file + self.tb_hierarchical_cats_model.commit() diff --git a/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py b/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py index 86ef1e83bb..e723acb5e9 100644 --- a/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py +++ b/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py @@ -6,8 +6,8 @@ __copyright__ = '2010, Kovid Goyal ' __docformat__ = 'restructuredtext en' import copy -from functools import partial import os +from functools import partial from qt.core import QAbstractItemView, QApplication, QIcon, QMenu, Qt, QTableWidgetItem @@ -168,3 +168,4 @@ class TbIconRulesTab(ConfigTabWidget, Ui_Form): if len(v[category]) == 0: v.pop(category, None) gprefs['tags_browser_value_icons'] = v + return rr