From 9b049b6469fd7eab16896cc9a2707323b6129315 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Fri, 8 May 2020 21:02:30 +0200 Subject: [PATCH] Moved spell checker classes to core folder --- nw/core/__init__.py | 6 ++++++ nw/{tools => core}/spellcheck.py | 0 nw/gui/dialogs/configeditor.py | 2 +- nw/gui/elements/doceditor.py | 4 ++-- nw/gui/statusbar.py | 2 +- nw/tools/__init__.py | 6 ------ 6 files changed, 10 insertions(+), 10 deletions(-) rename nw/{tools => core}/spellcheck.py (100%) diff --git a/nw/core/__init__.py b/nw/core/__init__.py index 8bc04dcd..29ba7051 100644 --- a/nw/core/__init__.py +++ b/nw/core/__init__.py @@ -3,9 +3,15 @@ from nw.core.document import NWDoc from nw.core.index import NWIndex from nw.core.project import NWProject +from nw.core.spellcheck import NWSpellCheck +from nw.core.spellcheck import NWSpellEnchant +from nw.core.spellcheck import NWSpellSimple __all__ = [ "NWDoc", "NWIndex", "NWProject", + "NWSpellCheck", + "NWSpellEnchant", + "NWSpellSimple", ] diff --git a/nw/tools/spellcheck.py b/nw/core/spellcheck.py similarity index 100% rename from nw/tools/spellcheck.py rename to nw/core/spellcheck.py diff --git a/nw/gui/dialogs/configeditor.py b/nw/gui/dialogs/configeditor.py index ac0ed592..7a6f167b 100644 --- a/nw/gui/dialogs/configeditor.py +++ b/nw/gui/dialogs/configeditor.py @@ -39,7 +39,7 @@ from PyQt5.QtWidgets import ( ) from nw.additions import QSwitch, QConfigLayout -from nw.tools import NWSpellCheck, NWSpellSimple, NWSpellEnchant +from nw.core import NWSpellCheck, NWSpellSimple, NWSpellEnchant from nw.constants import nwAlert, nwQuotes logger = logging.getLogger(__name__) diff --git a/nw/gui/elements/doceditor.py b/nw/gui/elements/doceditor.py index f7d494e1..a6d76958 100644 --- a/nw/gui/elements/doceditor.py +++ b/nw/gui/elements/doceditor.py @@ -42,7 +42,7 @@ from PyQt5.QtGui import ( from nw.core import NWDoc from nw.gui.tools import GuiDocHighlighter, WordCounter from nw.gui.elements.doctitlebar import GuiDocTitleBar -from nw.tools import NWSpellSimple +from nw.core import NWSpellSimple from nw.constants import nwUnicode, nwDocAction logger = logging.getLogger(__name__) @@ -1007,7 +1007,7 @@ class GuiDocEditor(QTextEdit): """ if self.mainConf.spellTool == "enchant": - from nw.tools.spellcheck import NWSpellEnchant + from nw.core.spellcheck import NWSpellEnchant self.theDict = NWSpellEnchant() else: self.theDict = NWSpellSimple() diff --git a/nw/gui/statusbar.py b/nw/gui/statusbar.py index f2492910..d815dd54 100644 --- a/nw/gui/statusbar.py +++ b/nw/gui/statusbar.py @@ -34,7 +34,7 @@ from PyQt5.QtCore import Qt, QTimer from PyQt5.QtGui import QColor, QPixmap, QFont from PyQt5.QtWidgets import QStatusBar, QLabel -from nw.tools import NWSpellCheck +from nw.core import NWSpellCheck logger = logging.getLogger(__name__) diff --git a/nw/tools/__init__.py b/nw/tools/__init__.py index 14ddbc7c..271db24c 100644 --- a/nw/tools/__init__.py +++ b/nw/tools/__init__.py @@ -3,9 +3,6 @@ from nw.tools.analyse import TextAnalysis from nw.tools.legacy import projectMaintenance from nw.tools.optionstate import OptionState -from nw.tools.spellcheck import NWSpellCheck -from nw.tools.spellcheck import NWSpellEnchant -from nw.tools.spellcheck import NWSpellSimple from nw.tools.translate import numberToWord from nw.tools.wordcount import countWords @@ -13,9 +10,6 @@ __all__ = [ "TextAnalysis", "projectMaintenance", "OptionState", - "NWSpellCheck", - "NWSpellEnchant", - "NWSpellSimple", "numberToWord", "countWords", ]