From a8bec3448e87c11f8d386400fe178c399a1ed7f6 Mon Sep 17 00:00:00 2001 From: overkill <22098433+0verk1ll@users.noreply.github.com> Date: Sun, 21 Mar 2021 13:52:10 -0400 Subject: [PATCH 1/3] I removed the duplicate `import` of `collections`. I made this change to address a suggestion from LGTM (https://lgtm.com/projects/g/kovidgoyal/calibre?mode=tree&severity=recommendation&ruleFocus=1818040193). --- src/calibre/gui2/ui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 766035e49a..1efdfcd5da 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -10,7 +10,6 @@ __docformat__ = 'restructuredtext en' '''The main GUI''' import apsw -import collections import errno import gc import os @@ -18,7 +17,9 @@ import re import sys import textwrap import time -from collections import OrderedDict +from collections import ( + OrderedDict, deque +) from io import BytesIO from qt.core import ( QAction, QApplication, QDialog, QFont, QIcon, QMenu, QSystemTrayIcon, Qt, QTimer, @@ -241,7 +242,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ self.metadata_dialogs = [] self.default_thumbnail = None self.tb_wrapper = textwrap.TextWrapper(width=40) - self.viewers = collections.deque() + self.viewers = deque() self.system_tray_icon = None do_systray = config['systray_icon'] or opts.start_in_tray if do_systray: From c381a5c31bf3eae16572d57ce77c51723db12d13 Mon Sep 17 00:00:00 2001 From: overkill <22098433+0verk1ll@users.noreply.github.com> Date: Sun, 21 Mar 2021 14:28:46 -0400 Subject: [PATCH 2/3] Make Indentation Consistent I added two more spaces to make my indentation consistent. --- src/calibre/gui2/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 1efdfcd5da..d992f9e1cc 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -18,7 +18,7 @@ import sys import textwrap import time from collections import ( - OrderedDict, deque + OrderedDict, deque ) from io import BytesIO from qt.core import ( From 61cacccbc5dd79244ea1731cfe8b582a1547cf64 Mon Sep 17 00:00:00 2001 From: overkill <22098433+0verk1ll@users.noreply.github.com> Date: Sun, 21 Mar 2021 17:21:29 -0400 Subject: [PATCH 3/3] Make `collections import` one line. --- src/calibre/gui2/ui.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index d992f9e1cc..4ad7f456d4 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -17,9 +17,7 @@ import re import sys import textwrap import time -from collections import ( - OrderedDict, deque -) +from collections import OrderedDict, deque from io import BytesIO from qt.core import ( QAction, QApplication, QDialog, QFont, QIcon, QMenu, QSystemTrayIcon, Qt, QTimer,