From eb66b879c5bd09bb7d99635bec9495cf53da9173 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 26 Sep 2020 13:02:51 +0200 Subject: [PATCH] Imports cleanup --- codecov.yml | 2 +- nw/constants/iso.py | 4 ---- nw/core/index.py | 2 +- nw/core/project.py | 5 +++-- nw/core/spellcheck.py | 2 +- nw/gui/about.py | 2 +- nw/gui/buildnovel.py | 2 +- nw/gui/custom.py | 2 +- nw/gui/doceditor.py | 2 +- nw/gui/dochighlight.py | 2 +- nw/gui/docmerge.py | 2 +- nw/gui/docsplit.py | 8 +++++--- nw/gui/docviewer.py | 2 +- nw/gui/itemdetails.py | 2 +- nw/gui/itemeditor.py | 2 +- nw/gui/mainmenu.py | 2 +- nw/gui/outline.py | 2 +- nw/gui/outlinedetails.py | 2 +- nw/gui/preferences.py | 2 +- nw/gui/projload.py | 2 +- nw/gui/projsettings.py | 2 +- nw/gui/projtree.py | 2 +- nw/gui/projwizard.py | 2 +- nw/gui/statusbar.py | 2 +- nw/gui/theme.py | 2 +- nw/gui/writingstats.py | 2 +- nw/guimain.py | 12 ++++++------ 27 files changed, 37 insertions(+), 38 deletions(-) diff --git a/codecov.yml b/codecov.yml index a649e6c3..cf6354e4 100644 --- a/codecov.yml +++ b/codecov.yml @@ -4,7 +4,7 @@ codecov: coverage: precision: 2 round: nearest - range: "70...90" + range: "70...95" status: project: diff --git a/nw/constants/iso.py b/nw/constants/iso.py index c3b663a2..69bd6d23 100644 --- a/nw/constants/iso.py +++ b/nw/constants/iso.py @@ -25,10 +25,6 @@ along with this program. If not, see . """ -import logging - -logger = logging.getLogger(__name__) - class isoLanguage(): ISO_639_1 = { diff --git a/nw/core/index.py b/nw/core/index.py index b32fd0c4..c148abd7 100644 --- a/nw/core/index.py +++ b/nw/core/index.py @@ -25,9 +25,9 @@ along with this program. If not, see . """ +import nw import logging import json -import nw from os import path from time import time diff --git a/nw/core/project.py b/nw/core/project.py index 6ac212a1..43885cce 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from os import path, mkdir, listdir, unlink, rename, rmdir from lxml import etree @@ -41,7 +41,8 @@ from nw.core.document import NWDoc from nw.core.status import NWStatus from nw.core.options import OptionState from nw.common import ( - checkString, checkBool, checkInt, isHandle, formatTimeStamp, makeFileNameSafe + checkString, checkBool, checkInt, isHandle, formatTimeStamp, + makeFileNameSafe ) from nw.constants import ( nwFiles, nwItemType, nwItemClass, nwItemLayout, nwLabels, nwAlert diff --git a/nw/core/spellcheck.py b/nw/core/spellcheck.py index 9c3a581c..b51a9a63 100644 --- a/nw/core/spellcheck.py +++ b/nw/core/spellcheck.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from os import path, listdir from difflib import get_close_matches diff --git a/nw/gui/about.py b/nw/gui/about.py index 64730c25..add97c7c 100644 --- a/nw/gui/about.py +++ b/nw/gui/about.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from os import path from datetime import datetime diff --git a/nw/gui/buildnovel.py b/nw/gui/buildnovel.py index 5c6af5fc..ad2c3248 100644 --- a/nw/gui/buildnovel.py +++ b/nw/gui/buildnovel.py @@ -25,9 +25,9 @@ along with this program. If not, see . """ +import nw import logging import json -import nw from os import path from time import time diff --git a/nw/gui/custom.py b/nw/gui/custom.py index ea557b51..e4e9f0c9 100644 --- a/nw/gui/custom.py +++ b/nw/gui/custom.py @@ -27,8 +27,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtGui import QColor, QPalette, QPainter, QFontMetrics from PyQt5.QtCore import ( diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index ecc51a1c..1410c7b4 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -30,8 +30,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from time import time diff --git a/nw/gui/dochighlight.py b/nw/gui/dochighlight.py index 786fa859..7b95ffeb 100644 --- a/nw/gui/dochighlight.py +++ b/nw/gui/dochighlight.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtCore import Qt, QRegularExpression from PyQt5.QtGui import ( diff --git a/nw/gui/docmerge.py b/nw/gui/docmerge.py index 8df427c6..786eb429 100644 --- a/nw/gui/docmerge.py +++ b/nw/gui/docmerge.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( diff --git a/nw/gui/docsplit.py b/nw/gui/docsplit.py index 802419b8..766d84f5 100644 --- a/nw/gui/docsplit.py +++ b/nw/gui/docsplit.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( @@ -34,9 +34,11 @@ from PyQt5.QtWidgets import ( QListWidgetItem, QDialogButtonBox, QLabel, QMessageBox ) -from nw.constants import nwAlert, nwItemType, nwItemClass, nwItemLayout, nwConst -from nw.gui.custom import QHelpLabel from nw.core import NWDoc +from nw.gui.custom import QHelpLabel +from nw.constants import ( + nwAlert, nwItemType, nwItemClass, nwItemLayout, nwConst +) logger = logging.getLogger(__name__) diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index da8a7458..2d24efc1 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -29,8 +29,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtCore import Qt, QUrl, QSize, pyqtSlot from PyQt5.QtGui import ( diff --git a/nw/gui/itemdetails.py b/nw/gui/itemdetails.py index d5a98254..f64d570b 100644 --- a/nw/gui/itemdetails.py +++ b/nw/gui/itemdetails.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtCore import Qt from PyQt5.QtGui import QFont, QPixmap diff --git a/nw/gui/itemeditor.py b/nw/gui/itemeditor.py index 42eef5eb..95a68c82 100644 --- a/nw/gui/itemeditor.py +++ b/nw/gui/itemeditor.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtWidgets import ( QDialog, QVBoxLayout, QGridLayout, QLineEdit, QComboBox, QLabel, diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index 214446a9..5dbbede3 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtCore import QUrl, QProcess from PyQt5.QtGui import QDesktopServices diff --git a/nw/gui/outline.py b/nw/gui/outline.py index 62335934..fcee1d8c 100644 --- a/nw/gui/outline.py +++ b/nw/gui/outline.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from time import time diff --git a/nw/gui/outlinedetails.py b/nw/gui/outlinedetails.py index 95a6de1b..c6372826 100644 --- a/nw/gui/outlinedetails.py +++ b/nw/gui/outlinedetails.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( diff --git a/nw/gui/preferences.py b/nw/gui/preferences.py index b2e175f5..121d2fd1 100644 --- a/nw/gui/preferences.py +++ b/nw/gui/preferences.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from os import path diff --git a/nw/gui/projload.py b/nw/gui/projload.py index 65dac1d4..54e40a11 100644 --- a/nw/gui/projload.py +++ b/nw/gui/projload.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from os import path from datetime import datetime diff --git a/nw/gui/projsettings.py b/nw/gui/projsettings.py index 48a73ab3..f5afa35e 100644 --- a/nw/gui/projsettings.py +++ b/nw/gui/projsettings.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtCore import Qt from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index 2f7833a5..21dea08c 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -26,8 +26,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from PyQt5.QtCore import Qt, QSize from PyQt5.QtGui import QIcon diff --git a/nw/gui/projwizard.py b/nw/gui/projwizard.py index ec74a184..475ec907 100644 --- a/nw/gui/projwizard.py +++ b/nw/gui/projwizard.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from os import path diff --git a/nw/gui/statusbar.py b/nw/gui/statusbar.py index 61cf0409..914fedae 100644 --- a/nw/gui/statusbar.py +++ b/nw/gui/statusbar.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from time import time diff --git a/nw/gui/theme.py b/nw/gui/theme.py index 1173c711..9b19ca40 100644 --- a/nw/gui/theme.py +++ b/nw/gui/theme.py @@ -26,9 +26,9 @@ along with this program. If not, see . """ +import nw import logging import configparser -import nw from os import path, listdir from math import ceil diff --git a/nw/gui/writingstats.py b/nw/gui/writingstats.py index e3419a3e..c356f7f4 100644 --- a/nw/gui/writingstats.py +++ b/nw/gui/writingstats.py @@ -25,9 +25,9 @@ along with this program. If not, see . """ +import nw import logging import json -import nw from os import path from datetime import datetime diff --git a/nw/guimain.py b/nw/guimain.py index 3d7f2d0b..06828f2e 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -25,8 +25,8 @@ along with this program. If not, see . """ -import logging import nw +import logging from os import path from datetime import datetime @@ -40,11 +40,11 @@ from PyQt5.QtWidgets import ( ) from nw.gui import ( - GuiBuildNovel, GuiDocEditor, GuiDocMerge, GuiDocSplit, GuiDocViewDetails, - GuiDocViewer, GuiItemDetails, GuiItemEditor, GuiMainMenu, GuiMainStatus, - GuiOutline, GuiOutlineDetails, GuiPreferences, GuiProjectLoad, GuiTheme, - GuiProjectSettings, GuiProjectTree, GuiWritingStats, GuiProjectWizard, - GuiAbout + GuiAbout, GuiBuildNovel, GuiDocEditor, GuiDocMerge, GuiDocSplit, + GuiDocViewDetails, GuiDocViewer, GuiItemDetails, GuiItemEditor, + GuiMainMenu, GuiMainStatus, GuiOutline, GuiOutlineDetails, GuiPreferences, + GuiProjectLoad, GuiProjectSettings, GuiProjectTree, GuiProjectWizard, + GuiTheme, GuiWritingStats ) from nw.core import NWProject, NWDoc, NWIndex from nw.constants import nwItemType, nwItemClass, nwAlert