Fix circular imports (#1166)

This commit is contained in:
Veronica Berglyd Olsen
2022-10-14 19:45:05 +02:00
committed by GitHub
37 changed files with 55 additions and 40 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ from PyQt5.QtWidgets import (
QListWidget, QListWidgetItem, QVBoxLayout, QListWidget, QListWidgetItem, QVBoxLayout,
) )
from novelwriter.gui.custom import QHelpLabel, QSwitch from novelwriter.custom import QHelpLabel, QSwitch
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -34,7 +34,7 @@ from PyQt5.QtWidgets import (
) )
from novelwriter.core import NWDoc from novelwriter.core import NWDoc
from novelwriter.gui.custom import QHelpLabel, QSwitch from novelwriter.custom import QHelpLabel, QSwitch
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -35,7 +35,7 @@ from PyQt5.QtWidgets import (
) )
from novelwriter.enum import nwAlert from novelwriter.enum import nwAlert
from novelwriter.gui.custom import QSwitch, QConfigLayout, PagedDialog from novelwriter.custom import QSwitch, QConfigLayout, PagedDialog
from novelwriter.dialogs.quotes import GuiQuoteSelect from novelwriter.dialogs.quotes import GuiQuoteSelect
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -37,8 +37,8 @@ from PyQt5.QtWidgets import (
from novelwriter.enum import nwItemClass from novelwriter.enum import nwItemClass
from novelwriter.common import numberToRoman from novelwriter.common import numberToRoman
from novelwriter.custom import PagedDialog, QSwitch
from novelwriter.constants import nwLabels, nwUnicode from novelwriter.constants import nwLabels, nwUnicode
from novelwriter.gui.custom import PagedDialog, QSwitch
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -36,7 +36,7 @@ from PyQt5.QtWidgets import (
from novelwriter.enum import nwAlert from novelwriter.enum import nwAlert
from novelwriter.common import simplified from novelwriter.common import simplified
from novelwriter.gui.custom import QSwitch, PagedDialog, QConfigLayout from novelwriter.custom import QSwitch, PagedDialog, QConfigLayout
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -2
View File
@@ -39,8 +39,7 @@ from PyQt5.QtWidgets import (
QVBoxLayout, QWidget QVBoxLayout, QWidget
) )
from novelwriter.core import DocMerger from novelwriter.core import DocMerger, DocSplitter
from novelwriter.core.doctools import DocSplitter
from novelwriter.enum import nwDocMode, nwItemType, nwItemClass, nwItemLayout, nwAlert from novelwriter.enum import nwDocMode, nwItemType, nwItemClass, nwItemLayout, nwAlert
from novelwriter.dialogs import GuiDocMerge, GuiDocSplit, GuiEditLabel from novelwriter.dialogs import GuiDocMerge, GuiDocSplit, GuiEditLabel
from novelwriter.constants import nwHeaders, trConst, nwLabels from novelwriter.constants import nwHeaders, trConst, nwLabels
+1 -1
View File
@@ -47,8 +47,8 @@ from novelwriter.core import ToHtml, ToOdt, ToMarkdown
from novelwriter.enum import nwAlert, nwItemType, nwItemLayout, nwItemClass from novelwriter.enum import nwAlert, nwItemType, nwItemLayout, nwItemClass
from novelwriter.error import formatException, logException from novelwriter.error import formatException, logException
from novelwriter.common import fuzzyTime, makeFileNameSafe from novelwriter.common import fuzzyTime, makeFileNameSafe
from novelwriter.custom import QSwitch
from novelwriter.constants import nwConst, nwFiles from novelwriter.constants import nwConst, nwFiles
from novelwriter.gui.custom import QSwitch
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -34,8 +34,8 @@ from PyQt5.QtWidgets import (
QSpinBox QSpinBox
) )
from novelwriter.gui.custom import QSwitch
from novelwriter.common import readTextFile from novelwriter.common import readTextFile
from novelwriter.custom import QSwitch
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -35,7 +35,7 @@ from PyQt5.QtWidgets import (
) )
from novelwriter.common import makeFileNameSafe from novelwriter.common import makeFileNameSafe
from novelwriter.gui.custom import QSwitch from novelwriter.custom import QSwitch
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -40,8 +40,8 @@ from PyQt5.QtWidgets import (
from novelwriter.enum import nwAlert from novelwriter.enum import nwAlert
from novelwriter.error import formatException from novelwriter.error import formatException
from novelwriter.common import formatTime, checkInt, checkIntRange, checkIntTuple from novelwriter.common import formatTime, checkInt, checkIntRange, checkIntTuple
from novelwriter.custom import QSwitch
from novelwriter.constants import nwConst, nwFiles from novelwriter.constants import nwConst, nwFiles
from novelwriter.gui.custom import QSwitch
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+3 -1
View File
@@ -27,7 +27,9 @@ from shutil import copyfile
from mock import causeOSError from mock import causeOSError
from tools import C, buildTestProject, cmpFiles from tools import C, buildTestProject, cmpFiles
from novelwriter.core import NWProject, DocMerger, DocSplitter, NWDoc from novelwriter.core.project import NWProject
from novelwriter.core.doctools import DocMerger, DocSplitter
from novelwriter.core.document import NWDoc
@pytest.mark.core @pytest.mark.core
+2 -1
View File
@@ -25,8 +25,9 @@ import pytest
from mock import causeOSError from mock import causeOSError
from tools import readFile, writeFile from tools import readFile, writeFile
from novelwriter.core import NWProject, NWDoc
from novelwriter.enum import nwItemClass, nwItemLayout from novelwriter.enum import nwItemClass, nwItemLayout
from novelwriter.core.project import NWProject
from novelwriter.core.document import NWDoc
@pytest.mark.core @pytest.mark.core
+2 -2
View File
@@ -28,9 +28,9 @@ from shutil import copyfile
from mock import causeException from mock import causeException
from tools import buildTestProject, cmpFiles, writeFile from tools import buildTestProject, cmpFiles, writeFile
from novelwriter.core.project import NWProject
from novelwriter.core.index import NWIndex, countWords, TagsIndex
from novelwriter.enum import nwItemClass, nwItemLayout from novelwriter.enum import nwItemClass, nwItemLayout
from novelwriter.core.index import NWIndex, countWords, TagsIndex
from novelwriter.core.project import NWProject
@pytest.mark.core @pytest.mark.core
+1 -1
View File
@@ -25,8 +25,8 @@ from lxml import etree
from PyQt5.QtGui import QIcon from PyQt5.QtGui import QIcon
from novelwriter.core import NWProject
from novelwriter.core.item import NWItem from novelwriter.core.item import NWItem
from novelwriter.core.project import NWProject
from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout
+1 -1
View File
@@ -26,8 +26,8 @@ import pytest
from mock import causeOSError from mock import causeOSError
from tools import writeFile from tools import writeFile
from novelwriter.core import NWProject
from novelwriter.core.options import OptionState from novelwriter.core.options import OptionState
from novelwriter.core.project import NWProject
from novelwriter.constants import nwFiles from novelwriter.constants import nwFiles
+2 -1
View File
@@ -24,7 +24,8 @@ import pytest
from tools import readFile from tools import readFile
from novelwriter.core import NWProject, ToHtml from novelwriter.core.tohtml import ToHtml
from novelwriter.core.project import NWProject
@pytest.mark.core @pytest.mark.core
+2 -1
View File
@@ -24,7 +24,8 @@ import pytest
from tools import readFile from tools import readFile
from novelwriter.core import NWProject, NWDoc from novelwriter.core.project import NWProject
from novelwriter.core.document import NWDoc
from novelwriter.core.tokenizer import Tokenizer from novelwriter.core.tokenizer import Tokenizer
+2 -1
View File
@@ -24,7 +24,8 @@ import pytest
from tools import readFile from tools import readFile
from novelwriter.core import NWProject, ToMarkdown from novelwriter.core.tomd import ToMarkdown
from novelwriter.core.project import NWProject
@pytest.mark.core @pytest.mark.core
+2 -2
View File
@@ -28,8 +28,8 @@ from shutil import copyfile
from tools import cmpFiles from tools import cmpFiles
from novelwriter.core import NWProject, ToOdt from novelwriter.core.toodt import ToOdt, ODTParagraphStyle, ODTTextStyle, XMLParagraph, _mkTag
from novelwriter.core.toodt import ODTParagraphStyle, ODTTextStyle, XMLParagraph, _mkTag from novelwriter.core.project import NWProject
XML_NS = [ XML_NS = [
' xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"', ' xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"',
+3 -1
View File
@@ -27,9 +27,11 @@ from lxml import etree
from tools import readFile from tools import readFile
from novelwriter.core.project import NWProject, NWItem, NWTree
from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout
from novelwriter.constants import nwFiles from novelwriter.constants import nwFiles
from novelwriter.core.item import NWItem
from novelwriter.core.tree import NWTree
from novelwriter.core.project import NWProject
@pytest.fixture(scope="function") @pytest.fixture(scope="function")
+1 -1
View File
@@ -25,7 +25,7 @@ from tools import getGuiItem
from PyQt5.QtWidgets import QAction, QMessageBox from PyQt5.QtWidgets import QAction, QMessageBox
from novelwriter.dialogs import GuiAbout from novelwriter.dialogs.about import GuiAbout
@pytest.mark.gui @pytest.mark.gui
+3 -1
View File
@@ -24,7 +24,9 @@ import pytest
from PyQt5.QtCore import QItemSelectionModel from PyQt5.QtCore import QItemSelectionModel
from PyQt5.QtWidgets import QAction, QListWidgetItem, QDialog, QMessageBox from PyQt5.QtWidgets import QAction, QListWidgetItem, QDialog, QMessageBox
from novelwriter.dialogs import GuiQuoteSelect, GuiUpdates, GuiEditLabel from novelwriter.dialogs.quotes import GuiQuoteSelect
from novelwriter.dialogs.updates import GuiUpdates
from novelwriter.dialogs.editlabel import GuiEditLabel
@pytest.mark.gui @pytest.mark.gui
+1 -1
View File
@@ -26,7 +26,7 @@ from tools import buildTestProject, C
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMessageBox from PyQt5.QtWidgets import QMessageBox
from novelwriter.dialogs import GuiDocMerge from novelwriter.dialogs.docmerge import GuiDocMerge
@pytest.mark.gui @pytest.mark.gui
+2 -1
View File
@@ -25,7 +25,8 @@ from tools import C, buildTestProject
from PyQt5.QtWidgets import QMessageBox from PyQt5.QtWidgets import QMessageBox
from novelwriter.dialogs import GuiDocSplit, GuiEditLabel from novelwriter.dialogs.docsplit import GuiDocSplit
from novelwriter.dialogs.editlabel import GuiEditLabel
@pytest.mark.gui @pytest.mark.gui
+2 -1
View File
@@ -32,7 +32,8 @@ from PyQt5.QtWidgets import (
) )
from novelwriter.config import Config from novelwriter.config import Config
from novelwriter.dialogs import GuiPreferences, GuiQuoteSelect from novelwriter.dialogs.quotes import GuiQuoteSelect
from novelwriter.dialogs.preferences import GuiPreferences
keyDelay = 2 keyDelay = 2
typeDelay = 1 typeDelay = 1
+1 -1
View File
@@ -25,7 +25,7 @@ from tools import getGuiItem
from PyQt5.QtWidgets import QAction, QMessageBox from PyQt5.QtWidgets import QAction, QMessageBox
from novelwriter.dialogs import GuiProjectDetails from novelwriter.dialogs.projdetails import GuiProjectDetails
keyDelay = 2 keyDelay = 2
typeDelay = 1 typeDelay = 1
+1 -1
View File
@@ -30,7 +30,7 @@ from PyQt5.QtWidgets import (
QMessageBox QMessageBox
) )
from novelwriter.dialogs import GuiProjectLoad from novelwriter.dialogs.projload import GuiProjectLoad
keyDelay = 2 keyDelay = 2
typeDelay = 1 typeDelay = 1
+1 -1
View File
@@ -29,7 +29,7 @@ from PyQt5.QtGui import QColor
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDialog, QAction, QMessageBox, QColorDialog from PyQt5.QtWidgets import QDialog, QAction, QMessageBox, QColorDialog
from novelwriter.dialogs import GuiProjectSettings from novelwriter.dialogs.projsettings import GuiProjectSettings
keyDelay = 2 keyDelay = 2
typeDelay = 1 typeDelay = 1
+1 -1
View File
@@ -28,8 +28,8 @@ from PyQt5.QtWidgets import QDialog, QMessageBox, QAction
from tools import writeFile, readFile, getGuiItem from tools import writeFile, readFile, getGuiItem
from mock import causeOSError from mock import causeOSError
from novelwriter.dialogs import GuiWordList
from novelwriter.constants import nwFiles from novelwriter.constants import nwFiles
from novelwriter.dialogs.wordlist import GuiWordList
keyDelay = 2 keyDelay = 2
typeDelay = 1 typeDelay = 1
+2 -2
View File
@@ -27,10 +27,10 @@ from PyQt5.QtCore import Qt
from PyQt5.QtGui import QTextBlock, QTextCursor, QTextOption from PyQt5.QtGui import QTextBlock, QTextCursor, QTextOption
from PyQt5.QtWidgets import QAction, QMessageBox, qApp from PyQt5.QtWidgets import QAction, QMessageBox, qApp
from novelwriter.gui.doceditor import GuiDocEditor
from novelwriter.core import countWords
from novelwriter.enum import nwDocAction, nwDocInsert, nwItemLayout from novelwriter.enum import nwDocAction, nwDocInsert, nwItemLayout
from novelwriter.constants import nwKeyWords, nwUnicode from novelwriter.constants import nwKeyWords, nwUnicode
from novelwriter.core.index import countWords
from novelwriter.gui.doceditor import GuiDocEditor
keyDelay = 2 keyDelay = 2
typeDelay = 1 typeDelay = 1
+1 -1
View File
@@ -27,7 +27,7 @@ from PyQt5.QtWidgets import qApp, QAction, QMessageBox
from mock import causeException from mock import causeException
from novelwriter.enum import nwDocAction from novelwriter.enum import nwDocAction
from novelwriter.core import ToHtml from novelwriter.core.tohtml import ToHtml
keyDelay = 2 keyDelay = 2
typeDelay = 1 typeDelay = 1
+3 -1
View File
@@ -28,11 +28,13 @@ from shutil import copyfile
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMessageBox, QInputDialog from PyQt5.QtWidgets import QMessageBox, QInputDialog
from novelwriter.gui import GuiDocEditor, GuiNovelView, GuiOutlineView
from novelwriter.enum import nwItemType, nwView, nwWidget from novelwriter.enum import nwItemType, nwView, nwWidget
from novelwriter.tools import GuiProjectWizard from novelwriter.tools import GuiProjectWizard
from novelwriter.dialogs import GuiEditLabel from novelwriter.dialogs import GuiEditLabel
from novelwriter.gui.outline import GuiOutlineView
from novelwriter.gui.projtree import GuiProjectTree from novelwriter.gui.projtree import GuiProjectTree
from novelwriter.gui.doceditor import GuiDocEditor
from novelwriter.gui.noveltree import GuiNovelView
keyDelay = 2 keyDelay = 2
typeDelay = 1 typeDelay = 1
+1 -1
View File
@@ -28,9 +28,9 @@ from PyQt5.QtWidgets import QAction, QFileDialog, QMessageBox
from tools import C, writeFile, buildTestProject from tools import C, writeFile, buildTestProject
from novelwriter.gui.doceditor import GuiDocEditor
from novelwriter.enum import nwDocAction, nwDocInsert from novelwriter.enum import nwDocAction, nwDocInsert
from novelwriter.constants import nwKeyWords, nwUnicode from novelwriter.constants import nwKeyWords, nwUnicode
from novelwriter.gui.doceditor import GuiDocEditor
keyDelay = 2 keyDelay = 2
typeDelay = 1 typeDelay = 1
+1 -1
View File
@@ -29,8 +29,8 @@ from PyQt5.QtCore import Qt, QEvent
from PyQt5.QtWidgets import QMessageBox, QToolTip from PyQt5.QtWidgets import QMessageBox, QToolTip
from novelwriter.enum import nwWidget, nwItemType from novelwriter.enum import nwWidget, nwItemType
from novelwriter.dialogs import GuiEditLabel
from novelwriter.gui.noveltree import NovelTreeColumn from novelwriter.gui.noveltree import NovelTreeColumn
from novelwriter.dialogs.editlabel import GuiEditLabel
@pytest.mark.gui @pytest.mark.gui
+3 -1
View File
@@ -30,8 +30,10 @@ from PyQt5.QtWidgets import QMessageBox, QMenu, QTreeWidgetItem, QDialog
from novelwriter.enum import nwItemLayout, nwItemType, nwItemClass from novelwriter.enum import nwItemLayout, nwItemType, nwItemClass
from novelwriter.core import NWDoc from novelwriter.core import NWDoc
from novelwriter.dialogs import GuiEditLabel, GuiDocMerge, GuiDocSplit
from novelwriter.gui.projtree import GuiProjectTree from novelwriter.gui.projtree import GuiProjectTree
from novelwriter.dialogs.docmerge import GuiDocMerge
from novelwriter.dialogs.docsplit import GuiDocSplit
from novelwriter.dialogs.editlabel import GuiEditLabel
@pytest.mark.gui @pytest.mark.gui
+1 -1
View File
@@ -26,8 +26,8 @@ from tools import C, buildTestProject
from PyQt5.QtWidgets import QMessageBox from PyQt5.QtWidgets import QMessageBox
from novelwriter.core import NWDoc
from novelwriter.enum import nwState from novelwriter.enum import nwState
from novelwriter.core.document import NWDoc
@pytest.mark.gui @pytest.mark.gui