diff --git a/src/calibre/gui2/preferences/behavior.py b/src/calibre/gui2/preferences/behavior.py index fdc1b4499d..9ff97c99e1 100644 --- a/src/calibre/gui2/preferences/behavior.py +++ b/src/calibre/gui2/preferences/behavior.py @@ -108,7 +108,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): fmts = config['internally_viewed_formats'] viewer = self.opt_internally_viewed_formats viewer.blockSignals(True) - exts = set([]) + exts = set() for ext in BOOK_EXTENSIONS: ext = ext.lower() ext = re.sub(r'(x{0,1})htm(l{0,1})', 'html', ext) diff --git a/src/calibre/gui2/preferences/misc.py b/src/calibre/gui2/preferences/misc.py index e7dbd1867f..617d6a64ff 100644 --- a/src/calibre/gui2/preferences/misc.py +++ b/src/calibre/gui2/preferences/misc.py @@ -9,7 +9,7 @@ import textwrap from calibre.gui2.preferences import ConfigWidgetBase, test_widget, Setting from calibre.gui2.preferences.misc_ui import Ui_Form -from calibre.gui2 import (config, open_local_file, gprefs) +from calibre.gui2 import config, open_local_file, gprefs from calibre import get_proxies from polyglot.builtins import iteritems diff --git a/src/calibre/gui2/preferences/plugins.py b/src/calibre/gui2/preferences/plugins.py index c3c777f1e9..21c53f0e7e 100644 --- a/src/calibre/gui2/preferences/plugins.py +++ b/src/calibre/gui2/preferences/plugins.py @@ -64,7 +64,7 @@ class PluginModel(QAbstractItemModel, AdaptSQP): # {{{ plugins.sort(key=lambda x: x.name.lower()) def universal_set(self): - ans = set([]) + ans = set() for c, category in enumerate(self.categories): ans.add((c, -1)) for p, plugin in enumerate(self._data[category]): @@ -74,7 +74,7 @@ class PluginModel(QAbstractItemModel, AdaptSQP): # {{{ def get_matches(self, location, query, candidates=None): if candidates is None: candidates = self.universal_set() - ans = set([]) + ans = set() if not query: return ans query = lower(query) diff --git a/src/calibre/gui2/preferences/toolbar.py b/src/calibre/gui2/preferences/toolbar.py index c1bbad6a45..eec30a2859 100644 --- a/src/calibre/gui2/preferences/toolbar.py +++ b/src/calibre/gui2/preferences/toolbar.py @@ -22,13 +22,13 @@ def sort_key_for_action(ac): q = ac.name if q is None else q[0] return primary_sort_key(force_unicode(q)) except Exception: - return primary_sort_key(u'') + return primary_sort_key('') class FakeAction(object): def __init__(self, name, gui_name, icon, tooltip=None, - dont_add_to=frozenset([]), dont_remove_from=frozenset([])): + dont_add_to=frozenset(), dont_remove_from=frozenset()): self.name = name self.action_spec = (gui_name, icon, tooltip, None) self.dont_remove_from = dont_remove_from @@ -131,7 +131,7 @@ class AllModel(BaseModel): def remove(self, indices, allowed): rows = [i.row() for i in indices] - remove = set([]) + remove = set() for row in rows: ac = self._data[row] if ac.name.startswith('---'): @@ -181,7 +181,7 @@ class CurrentModel(BaseModel): def add(self, names): actions = [] - reject = set([]) + reject = set() for name in names: ac = self.name_to_action(name, self.gui) if self.key in ac.dont_add_to: @@ -196,7 +196,7 @@ class CurrentModel(BaseModel): def remove(self, indices): rows = [i.row() for i in indices] - remove, rejected = set([]), set([]) + remove, rejected = set(), set() for row in rows: ac = self._data[row] if self.key in ac.dont_remove_from: diff --git a/src/calibre/gui2/wizard/__init__.py b/src/calibre/gui2/wizard/__init__.py index 8f4a4472d5..abb00ecece 100644 --- a/src/calibre/gui2/wizard/__init__.py +++ b/src/calibre/gui2/wizard/__init__.py @@ -417,7 +417,7 @@ def get_devices(): def get_manufacturers(): - mans = set([]) + mans = set() for x in get_devices(): mans.add(x.manufacturer) if Device.manufacturer in mans: diff --git a/src/calibre/library/custom_columns.py b/src/calibre/library/custom_columns.py index 80e25f9e3b..1d73744a06 100644 --- a/src/calibre/library/custom_columns.py +++ b/src/calibre/library/custom_columns.py @@ -536,7 +536,7 @@ class CustomColumns(object): if num is not None: data = self.custom_column_num_map[num] if data['datatype'] == 'composite': - return set([]) + return set() if not data['editable']: raise ValueError('Column %r is not editable'%data['label']) table, lt = self.custom_table_names(data['num']) @@ -549,7 +549,7 @@ class CustomColumns(object): if extra is None: extra = 1.0 - books_to_refresh = set([]) + books_to_refresh = set() if data['normalized']: if data['datatype'] == 'enumeration' and ( val and val not in data['display']['enum_values']): @@ -563,7 +563,7 @@ class CustomColumns(object): set_val = val if data['is_multiple'] else [val] existing = getter() if not existing: - existing = set([]) + existing = set() else: existing = set(existing) # preserve the order in set_val