diff --git a/nw/constants/constants.py b/nw/constants/constants.py index c6e17a15..cd7bf350 100644 --- a/nw/constants/constants.py +++ b/nw/constants/constants.py @@ -25,7 +25,7 @@ along with this program. If not, see . """ -from nw.constants.enum import nwItemClass, nwItemLayout, nwOutline, nwDocInsert +from nw.constants.enum import nwItemClass, nwItemLayout, nwOutline class nwConst(): diff --git a/nw/core/document.py b/nw/core/document.py index 560815e6..8c8b523f 100644 --- a/nw/core/document.py +++ b/nw/core/document.py @@ -28,7 +28,7 @@ import logging import nw -from os import path, mkdir, rename, unlink +from os import path, rename, unlink from nw.core.item import NWItem from nw.constants import nwAlert diff --git a/nw/core/tools.py b/nw/core/tools.py index dd2c8c84..b46f0db8 100644 --- a/nw/core/tools.py +++ b/nw/core/tools.py @@ -30,8 +30,6 @@ import logging import nw -from os import path, unlink, rmdir - logger = logging.getLogger(__name__) # =============================================================================================== # diff --git a/nw/error.py b/nw/error.py index 0301f3ba..e8466657 100644 --- a/nw/error.py +++ b/nw/error.py @@ -76,9 +76,9 @@ def exceptionHandler(exType, exValue, exTrace): """Function to catch unhandled global exceptions. """ import logging - from traceback import print_tb, format_tb + from traceback import print_tb from nw import CONFIG - from PyQt5.QtWidgets import qApp, QApplication, QErrorMessage, QMessageBox + from PyQt5.QtWidgets import qApp, QErrorMessage logger = logging.getLogger(__name__) logger.error("%s: %s" % (exType.__name__, str(exValue))) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index a4d88f65..2ec72b62 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -39,7 +39,7 @@ from PyQt5.QtCore import ( Qt, QSize, QThread, QTimer, pyqtSlot, QRegExp, QRegularExpression ) from PyQt5.QtGui import ( - QTextCursor, QTextOption, QKeySequence, QFont, QColor, QPalette, QIcon, + QTextCursor, QTextOption, QKeySequence, QFont, QColor, QPalette, QTextDocument, QCursor, QPixmap ) from PyQt5.QtWidgets import ( diff --git a/nw/gui/docsplit.py b/nw/gui/docsplit.py index d143a056..60b4069a 100644 --- a/nw/gui/docsplit.py +++ b/nw/gui/docsplit.py @@ -33,6 +33,7 @@ from PyQt5.QtWidgets import ( QDialog, QVBoxLayout, QComboBox, QListWidget, QAbstractItemView, QListWidgetItem, QDialogButtonBox, QLabel ) + from nw.constants import nwAlert, nwItemType, nwItemClass, nwItemLayout from nw.gui.custom import QHelpLabel from nw.core import NWDoc diff --git a/nw/gui/itemdetails.py b/nw/gui/itemdetails.py index 4d0f5641..dea27381 100644 --- a/nw/gui/itemdetails.py +++ b/nw/gui/itemdetails.py @@ -29,11 +29,11 @@ import logging import nw from PyQt5.QtCore import Qt -from PyQt5.QtGui import QFont, QIcon, QPixmap +from PyQt5.QtGui import QFont, QPixmap from PyQt5.QtWidgets import QWidget, QGridLayout, QLabel from nw.constants import ( - nwLabels, nwItemClass, nwItemType, nwItemLayout, nwUnicode + nwLabels, nwItemClass, nwItemType, nwItemLayout ) logger = logging.getLogger(__name__) diff --git a/nw/gui/itemeditor.py b/nw/gui/itemeditor.py index 65c4cde9..b1c2421a 100644 --- a/nw/gui/itemeditor.py +++ b/nw/gui/itemeditor.py @@ -28,7 +28,6 @@ import logging import nw -from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( QDialog, QVBoxLayout, QGridLayout, QLineEdit, QComboBox, QLabel, QDialogButtonBox diff --git a/nw/gui/outlinedetails.py b/nw/gui/outlinedetails.py index 5e197449..e18ac9d1 100644 --- a/nw/gui/outlinedetails.py +++ b/nw/gui/outlinedetails.py @@ -30,7 +30,8 @@ import nw from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( - QScrollArea, QWidget, QGridLayout, QHBoxLayout, QGroupBox, QLabel, QSizePolicy + QScrollArea, QWidget, QGridLayout, QHBoxLayout, QGroupBox, QLabel, + QSizePolicy ) from nw.constants import nwLabels, nwKeyWords diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index d6eb8cdf..3baf5257 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -30,15 +30,15 @@ import logging import nw from PyQt5.QtCore import Qt, QSize -from PyQt5.QtGui import QFont, QColor, QIcon +from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import ( qApp, QTreeWidget, QTreeWidgetItem, QAbstractItemView, QMessageBox, - QHeaderView, QMenu, QAction + QMenu, QAction ) from nw.core import NWDoc from nw.constants import ( - nwLabels, nwItemType, nwItemClass, nwItemLayout, nwAlert, nwUnicode + nwLabels, nwItemType, nwItemClass, nwItemLayout, nwAlert ) logger = logging.getLogger(__name__) diff --git a/nw/gui/statusbar.py b/nw/gui/statusbar.py index 040125aa..395fc5cc 100644 --- a/nw/gui/statusbar.py +++ b/nw/gui/statusbar.py @@ -30,8 +30,8 @@ import nw from time import time -from PyQt5.QtCore import Qt, QTimer -from PyQt5.QtGui import QColor, QPixmap, QFont, QPainter +from PyQt5.QtCore import QTimer +from PyQt5.QtGui import QColor, QPainter from PyQt5.QtWidgets import qApp, QStatusBar, QLabel, QAbstractButton from nw.core import NWSpellCheck diff --git a/nw/guimain.py b/nw/guimain.py index 09571d61..46db9d1f 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -46,7 +46,7 @@ from nw.gui import ( GuiProjectSettings, GuiProjectTree, GuiWritingStats, GuiAbout ) from nw.core import NWProject, NWDoc, NWIndex -from nw.constants import nwFiles, nwItemType, nwAlert +from nw.constants import nwItemType, nwAlert logger = logging.getLogger(__name__)