Fix circular imports (#1166)
This commit is contained in:
@@ -33,7 +33,7 @@ from PyQt5.QtWidgets import (
|
||||
QListWidget, QListWidgetItem, QVBoxLayout,
|
||||
)
|
||||
|
||||
from novelwriter.gui.custom import QHelpLabel, QSwitch
|
||||
from novelwriter.custom import QHelpLabel, QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from novelwriter.core import NWDoc
|
||||
from novelwriter.gui.custom import QHelpLabel, QSwitch
|
||||
from novelwriter.custom import QHelpLabel, QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -37,8 +37,8 @@ from PyQt5.QtWidgets import (
|
||||
|
||||
from novelwriter.enum import nwItemClass
|
||||
from novelwriter.common import numberToRoman
|
||||
from novelwriter.custom import PagedDialog, QSwitch
|
||||
from novelwriter.constants import nwLabels, nwUnicode
|
||||
from novelwriter.gui.custom import PagedDialog, QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ from PyQt5.QtWidgets import (
|
||||
|
||||
from novelwriter.enum import nwAlert
|
||||
from novelwriter.common import simplified
|
||||
from novelwriter.gui.custom import QSwitch, PagedDialog, QConfigLayout
|
||||
from novelwriter.custom import QSwitch, PagedDialog, QConfigLayout
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -39,8 +39,7 @@ from PyQt5.QtWidgets import (
|
||||
QVBoxLayout, QWidget
|
||||
)
|
||||
|
||||
from novelwriter.core import DocMerger
|
||||
from novelwriter.core.doctools import DocSplitter
|
||||
from novelwriter.core import DocMerger, DocSplitter
|
||||
from novelwriter.enum import nwDocMode, nwItemType, nwItemClass, nwItemLayout, nwAlert
|
||||
from novelwriter.dialogs import GuiDocMerge, GuiDocSplit, GuiEditLabel
|
||||
from novelwriter.constants import nwHeaders, trConst, nwLabels
|
||||
|
||||
@@ -47,8 +47,8 @@ from novelwriter.core import ToHtml, ToOdt, ToMarkdown
|
||||
from novelwriter.enum import nwAlert, nwItemType, nwItemLayout, nwItemClass
|
||||
from novelwriter.error import formatException, logException
|
||||
from novelwriter.common import fuzzyTime, makeFileNameSafe
|
||||
from novelwriter.custom import QSwitch
|
||||
from novelwriter.constants import nwConst, nwFiles
|
||||
from novelwriter.gui.custom import QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ from PyQt5.QtWidgets import (
|
||||
QSpinBox
|
||||
)
|
||||
|
||||
from novelwriter.gui.custom import QSwitch
|
||||
from novelwriter.common import readTextFile
|
||||
from novelwriter.custom import QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from novelwriter.common import makeFileNameSafe
|
||||
from novelwriter.gui.custom import QSwitch
|
||||
from novelwriter.custom import QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ from PyQt5.QtWidgets import (
|
||||
from novelwriter.enum import nwAlert
|
||||
from novelwriter.error import formatException
|
||||
from novelwriter.common import formatTime, checkInt, checkIntRange, checkIntTuple
|
||||
from novelwriter.custom import QSwitch
|
||||
from novelwriter.constants import nwConst, nwFiles
|
||||
from novelwriter.gui.custom import QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ from shutil import copyfile
|
||||
from mock import causeOSError
|
||||
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
|
||||
|
||||
@@ -25,8 +25,9 @@ import pytest
|
||||
from mock import causeOSError
|
||||
from tools import readFile, writeFile
|
||||
|
||||
from novelwriter.core import NWProject, NWDoc
|
||||
from novelwriter.enum import nwItemClass, nwItemLayout
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.core.document import NWDoc
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
|
||||
@@ -28,9 +28,9 @@ from shutil import copyfile
|
||||
from mock import causeException
|
||||
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.core.index import NWIndex, countWords, TagsIndex
|
||||
from novelwriter.core.project import NWProject
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
|
||||
@@ -25,8 +25,8 @@ from lxml import etree
|
||||
|
||||
from PyQt5.QtGui import QIcon
|
||||
|
||||
from novelwriter.core import NWProject
|
||||
from novelwriter.core.item import NWItem
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ import pytest
|
||||
from mock import causeOSError
|
||||
from tools import writeFile
|
||||
|
||||
from novelwriter.core import NWProject
|
||||
from novelwriter.core.options import OptionState
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.constants import nwFiles
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ import pytest
|
||||
|
||||
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
|
||||
|
||||
@@ -24,7 +24,8 @@ import pytest
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ import pytest
|
||||
|
||||
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
|
||||
|
||||
@@ -28,8 +28,8 @@ from shutil import copyfile
|
||||
|
||||
from tools import cmpFiles
|
||||
|
||||
from novelwriter.core import NWProject, ToOdt
|
||||
from novelwriter.core.toodt import ODTParagraphStyle, ODTTextStyle, XMLParagraph, _mkTag
|
||||
from novelwriter.core.toodt import ToOdt, ODTParagraphStyle, ODTTextStyle, XMLParagraph, _mkTag
|
||||
from novelwriter.core.project import NWProject
|
||||
|
||||
XML_NS = [
|
||||
' xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"',
|
||||
|
||||
@@ -27,9 +27,11 @@ from lxml import etree
|
||||
|
||||
from tools import readFile
|
||||
|
||||
from novelwriter.core.project import NWProject, NWItem, NWTree
|
||||
from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
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")
|
||||
|
||||
@@ -25,7 +25,7 @@ from tools import getGuiItem
|
||||
|
||||
from PyQt5.QtWidgets import QAction, QMessageBox
|
||||
|
||||
from novelwriter.dialogs import GuiAbout
|
||||
from novelwriter.dialogs.about import GuiAbout
|
||||
|
||||
|
||||
@pytest.mark.gui
|
||||
|
||||
@@ -24,7 +24,9 @@ import pytest
|
||||
from PyQt5.QtCore import QItemSelectionModel
|
||||
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
|
||||
|
||||
@@ -26,7 +26,7 @@ from tools import buildTestProject, C
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtWidgets import QMessageBox
|
||||
|
||||
from novelwriter.dialogs import GuiDocMerge
|
||||
from novelwriter.dialogs.docmerge import GuiDocMerge
|
||||
|
||||
|
||||
@pytest.mark.gui
|
||||
|
||||
@@ -25,7 +25,8 @@ from tools import C, buildTestProject
|
||||
|
||||
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
|
||||
|
||||
@@ -32,7 +32,8 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
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
|
||||
typeDelay = 1
|
||||
|
||||
@@ -25,7 +25,7 @@ from tools import getGuiItem
|
||||
|
||||
from PyQt5.QtWidgets import QAction, QMessageBox
|
||||
|
||||
from novelwriter.dialogs import GuiProjectDetails
|
||||
from novelwriter.dialogs.projdetails import GuiProjectDetails
|
||||
|
||||
keyDelay = 2
|
||||
typeDelay = 1
|
||||
|
||||
@@ -30,7 +30,7 @@ from PyQt5.QtWidgets import (
|
||||
QMessageBox
|
||||
)
|
||||
|
||||
from novelwriter.dialogs import GuiProjectLoad
|
||||
from novelwriter.dialogs.projload import GuiProjectLoad
|
||||
|
||||
keyDelay = 2
|
||||
typeDelay = 1
|
||||
|
||||
@@ -29,7 +29,7 @@ from PyQt5.QtGui import QColor
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtWidgets import QDialog, QAction, QMessageBox, QColorDialog
|
||||
|
||||
from novelwriter.dialogs import GuiProjectSettings
|
||||
from novelwriter.dialogs.projsettings import GuiProjectSettings
|
||||
|
||||
keyDelay = 2
|
||||
typeDelay = 1
|
||||
|
||||
@@ -28,8 +28,8 @@ from PyQt5.QtWidgets import QDialog, QMessageBox, QAction
|
||||
from tools import writeFile, readFile, getGuiItem
|
||||
from mock import causeOSError
|
||||
|
||||
from novelwriter.dialogs import GuiWordList
|
||||
from novelwriter.constants import nwFiles
|
||||
from novelwriter.dialogs.wordlist import GuiWordList
|
||||
|
||||
keyDelay = 2
|
||||
typeDelay = 1
|
||||
|
||||
@@ -27,10 +27,10 @@ from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QTextBlock, QTextCursor, QTextOption
|
||||
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.constants import nwKeyWords, nwUnicode
|
||||
from novelwriter.core.index import countWords
|
||||
from novelwriter.gui.doceditor import GuiDocEditor
|
||||
|
||||
keyDelay = 2
|
||||
typeDelay = 1
|
||||
|
||||
@@ -27,7 +27,7 @@ from PyQt5.QtWidgets import qApp, QAction, QMessageBox
|
||||
from mock import causeException
|
||||
|
||||
from novelwriter.enum import nwDocAction
|
||||
from novelwriter.core import ToHtml
|
||||
from novelwriter.core.tohtml import ToHtml
|
||||
|
||||
keyDelay = 2
|
||||
typeDelay = 1
|
||||
|
||||
@@ -28,11 +28,13 @@ from shutil import copyfile
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtWidgets import QMessageBox, QInputDialog
|
||||
|
||||
from novelwriter.gui import GuiDocEditor, GuiNovelView, GuiOutlineView
|
||||
from novelwriter.enum import nwItemType, nwView, nwWidget
|
||||
from novelwriter.tools import GuiProjectWizard
|
||||
from novelwriter.dialogs import GuiEditLabel
|
||||
from novelwriter.gui.outline import GuiOutlineView
|
||||
from novelwriter.gui.projtree import GuiProjectTree
|
||||
from novelwriter.gui.doceditor import GuiDocEditor
|
||||
from novelwriter.gui.noveltree import GuiNovelView
|
||||
|
||||
keyDelay = 2
|
||||
typeDelay = 1
|
||||
|
||||
@@ -28,9 +28,9 @@ from PyQt5.QtWidgets import QAction, QFileDialog, QMessageBox
|
||||
|
||||
from tools import C, writeFile, buildTestProject
|
||||
|
||||
from novelwriter.gui.doceditor import GuiDocEditor
|
||||
from novelwriter.enum import nwDocAction, nwDocInsert
|
||||
from novelwriter.constants import nwKeyWords, nwUnicode
|
||||
from novelwriter.gui.doceditor import GuiDocEditor
|
||||
|
||||
keyDelay = 2
|
||||
typeDelay = 1
|
||||
|
||||
@@ -29,8 +29,8 @@ from PyQt5.QtCore import Qt, QEvent
|
||||
from PyQt5.QtWidgets import QMessageBox, QToolTip
|
||||
|
||||
from novelwriter.enum import nwWidget, nwItemType
|
||||
from novelwriter.dialogs import GuiEditLabel
|
||||
from novelwriter.gui.noveltree import NovelTreeColumn
|
||||
from novelwriter.dialogs.editlabel import GuiEditLabel
|
||||
|
||||
|
||||
@pytest.mark.gui
|
||||
|
||||
@@ -30,8 +30,10 @@ from PyQt5.QtWidgets import QMessageBox, QMenu, QTreeWidgetItem, QDialog
|
||||
|
||||
from novelwriter.enum import nwItemLayout, nwItemType, nwItemClass
|
||||
from novelwriter.core import NWDoc
|
||||
from novelwriter.dialogs import GuiEditLabel, GuiDocMerge, GuiDocSplit
|
||||
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
|
||||
|
||||
@@ -26,8 +26,8 @@ from tools import C, buildTestProject
|
||||
|
||||
from PyQt5.QtWidgets import QMessageBox
|
||||
|
||||
from novelwriter.core import NWDoc
|
||||
from novelwriter.enum import nwState
|
||||
from novelwriter.core.document import NWDoc
|
||||
|
||||
|
||||
@pytest.mark.gui
|
||||
|
||||
Reference in New Issue
Block a user