Clean up imports

This commit is contained in:
Veronica K. B. Olsen
2019-11-03 19:44:58 +01:00
parent be7b69dc9a
commit 62988df7d2
23 changed files with 217 additions and 53 deletions
+5 -3
View File
@@ -14,10 +14,12 @@ import sys
import getopt import getopt
import logging import logging
from os import path, remove, rename from os import path, remove, rename
from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QApplication
from nw.gui.winmain import GuiMain
from nw.config import Config from nw.guimain import GuiMain
from nw.config import Config
__package__ = "novelWriter" __package__ = "novelWriter"
__author__ = "Veronica Berglyd Olsen" __author__ = "Veronica Berglyd Olsen"
+27
View File
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
from nw.convert.tokenizer import Tokenizer
from nw.convert.file.concat import ConcatFile
from nw.convert.file.html import HtmlFile
from nw.convert.file.latex import LaTeXFile
from nw.convert.file.markdown import MarkdownFile
from nw.convert.file.text import TextFile
from nw.convert.text.tohtml import ToHtml
from nw.convert.text.tolatex import ToLaTeX
from nw.convert.text.tomarkdown import ToMarkdown
from nw.convert.text.totext import ToText
__all__ = [
Tokenizer,
ConcatFile,
HtmlFile,
LaTeXFile,
MarkdownFile,
TextFile,
ToHtml,
ToLaTeX,
ToMarkdown,
ToText,
]
+15
View File
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
from nw.convert.file.concat import ConcatFile
from nw.convert.file.html import HtmlFile
from nw.convert.file.latex import LaTeXFile
from nw.convert.file.markdown import MarkdownFile
from nw.convert.file.text import TextFile
__all__ = [
ConcatFile,
HtmlFile,
LaTeXFile,
MarkdownFile,
TextFile,
]
+13
View File
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
from nw.convert.text.tohtml import ToHtml
from nw.convert.text.tolatex import ToLaTeX
from nw.convert.text.tomarkdown import ToMarkdown
from nw.convert.text.totext import ToText
__all__ = [
ToHtml,
ToLaTeX,
ToMarkdown,
ToText,
]
+46
View File
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
# Main Window Elements
from nw.gui.mainmenu import GuiMainMenu
from nw.gui.statusbar import GuiMainStatus
# Dialogs
from nw.gui.dialogs.configeditor import GuiConfigEditor
from nw.gui.dialogs.export import GuiExport
from nw.gui.dialogs.itemeditor import GuiItemEditor
from nw.gui.dialogs.projecteditor import GuiProjectEditor
from nw.gui.dialogs.sessionlog import GuiSessionLogView
from nw.gui.dialogs.timelineview import GuiTimeLineView
# GUI Elements
from nw.gui.elements.docdetails import GuiDocDetails
from nw.gui.elements.doceditor import GuiDocEditor
from nw.gui.elements.doctree import GuiDocTree
from nw.gui.elements.docviewer import GuiDocViewer
from nw.gui.elements.noticebar import GuiNoticeBar
from nw.gui.elements.searchbar import GuiSearchBar
from nw.gui.elements.viewdetails import GuiDocViewDetails
# Tools
from nw.gui.tools.dochighlight import GuiDocHighlighter
from nw.gui.tools.wordcounter import WordCounter
__all__ = [
GuiMainMenu,
GuiMainStatus,
GuiConfigEditor,
GuiExport,
GuiItemEditor,
GuiProjectEditor,
GuiSessionLogView,
GuiTimeLineView,
GuiDocDetails,
GuiDocEditor,
GuiDocTree,
GuiDocViewer,
GuiNoticeBar,
GuiSearchBar,
GuiDocViewDetails,
GuiDocHighlighter,
WordCounter,
]
+17
View File
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from nw.gui.dialogs.configeditor import GuiConfigEditor
from nw.gui.dialogs.export import GuiExport
from nw.gui.dialogs.itemeditor import GuiItemEditor
from nw.gui.dialogs.projecteditor import GuiProjectEditor
from nw.gui.dialogs.sessionlog import GuiSessionLogView
from nw.gui.dialogs.timelineview import GuiTimeLineView
__all__ = [
GuiConfigEditor,
GuiExport,
GuiItemEditor,
GuiProjectEditor,
GuiSessionLogView,
GuiTimeLineView,
]
+5 -3
View File
@@ -19,10 +19,12 @@ from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush, QStandardItemModel, QFont from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush, QStandardItemModel, QFont
from PyQt5.QtSvg import QSvgWidget from PyQt5.QtSvg import QSvgWidget
from PyQt5.QtWidgets import ( from PyQt5.QtWidgets import (
QDialog, QHBoxLayout, QVBoxLayout, QFormLayout, QLineEdit, QPlainTextEdit, QLabel, QDialog, QHBoxLayout, QVBoxLayout, QFormLayout, QLineEdit, QPlainTextEdit,
QWidget, QTabWidget, QDialogButtonBox, QSpinBox, QGroupBox, QComboBox, QMessageBox, QLabel, QWidget, QTabWidget, QDialogButtonBox, QSpinBox, QGroupBox,
QCheckBox, QGridLayout, QFontComboBox, QPushButton, QFileDialog QComboBox, QMessageBox, QCheckBox, QGridLayout, QFontComboBox, QPushButton,
QFileDialog
) )
from nw.enum import nwAlert from nw.enum import nwAlert
from nw.constants import nwQuotes from nw.constants import nwQuotes
+4 -9
View File
@@ -24,16 +24,11 @@ from PyQt5.QtWidgets import (
QFileDialog, QProgressBar, QSpinBox, QMessageBox QFileDialog, QProgressBar, QSpinBox, QMessageBox
) )
from nw.project.document import NWDoc from nw.convert import TextFile, HtmlFile, MarkdownFile, LaTeXFile, ConcatFile
from nw.tools.translate import numberToWord from nw.project import NWDoc
from nw.tools.optlaststate import OptLastState from nw.tools import numberToWord, OptLastState
from nw.convert.file.text import TextFile
from nw.convert.file.html import HtmlFile
from nw.convert.file.markdown import MarkdownFile
from nw.convert.file.latex import LaTeXFile
from nw.convert.file.concat import ConcatFile
from nw.common import packageRefURL
from nw.constants import nwFiles from nw.constants import nwFiles
from nw.common import packageRefURL
from nw.enum import nwItemType, nwAlert from nw.enum import nwItemType, nwAlert
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1
View File
@@ -24,6 +24,7 @@ from PyQt5.QtWidgets import (
QListWidgetItem, QPushButton, QColorDialog, QAbstractItemView, QTreeWidget, QListWidgetItem, QPushButton, QColorDialog, QAbstractItemView, QTreeWidget,
QTreeWidgetItem, QCheckBox QTreeWidgetItem, QCheckBox
) )
from nw.enum import nwAlert from nw.enum import nwAlert
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -24,8 +24,8 @@ from PyQt5.QtWidgets import (
QCheckBox QCheckBox
) )
from nw.tools.optlaststate import OptLastState
from nw.constants import nwConst, nwFiles from nw.constants import nwConst, nwFiles
from nw.tools import OptLastState
from nw.enum import nwAlert from nw.enum import nwAlert
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -23,8 +23,8 @@ from PyQt5.QtWidgets import (
QGroupBox, QCheckBox QGroupBox, QCheckBox
) )
from nw.tools.optlaststate import OptLastState
from nw.constants import nwFiles from nw.constants import nwFiles
from nw.tools import OptLastState
from nw.enum import nwItemClass from nw.enum import nwItemClass
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+19
View File
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from nw.gui.elements.docdetails import GuiDocDetails
from nw.gui.elements.doceditor import GuiDocEditor
from nw.gui.elements.doctree import GuiDocTree
from nw.gui.elements.docviewer import GuiDocViewer
from nw.gui.elements.noticebar import GuiNoticeBar
from nw.gui.elements.searchbar import GuiSearchBar
from nw.gui.elements.viewdetails import GuiDocViewDetails
__all__ = [
GuiDocDetails,
GuiDocEditor,
GuiDocTree,
GuiDocViewer,
GuiNoticeBar,
GuiSearchBar,
GuiDocViewDetails,
]
+3 -4
View File
@@ -24,10 +24,9 @@ from PyQt5.QtGui import (
QPalette, QTextDocument, QPalette, QTextDocument,
) )
from nw.project.document import NWDoc from nw.project import NWDoc
from nw.gui.tools.dochighlight import GuiDocHighlighter from nw.gui.tools import GuiDocHighlighter, WordCounter
from nw.gui.tools.wordcounter import WordCounter from nw.tools import NWSpellCheck
from nw.tools.spellcheck import NWSpellCheck
from nw.constants import nwFiles, nwUnicode from nw.constants import nwFiles, nwUnicode
from nw.enum import nwDocAction, nwAlert from nw.enum import nwDocAction, nwAlert
+1 -1
View File
@@ -19,7 +19,7 @@ from PyQt5.QtWidgets import (
QTreeWidget, QTreeWidgetItem, QAbstractItemView, QApplication QTreeWidget, QTreeWidgetItem, QAbstractItemView, QApplication
) )
from nw.project.item import NWItem from nw.project import NWItem
from nw.constants import nwLabels from nw.constants import nwLabels
from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert
+1 -2
View File
@@ -17,8 +17,7 @@ from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QTextBrowser from PyQt5.QtWidgets import QTextBrowser
from PyQt5.QtGui import QTextOption, QFont, QPalette, QColor from PyQt5.QtGui import QTextOption, QFont, QPalette, QColor
from nw.convert.tokenizer import Tokenizer from nw.convert import Tokenizer, ToHtml
from nw.convert.text.tohtml import ToHtml
from nw.enum import nwAlert, nwItemType from nw.enum import nwAlert, nwItemType
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+9
View File
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from nw.gui.tools.dochighlight import GuiDocHighlighter
from nw.gui.tools.wordcounter import WordCounter
__all__ = [
GuiDocHighlighter,
WordCounter,
]
+9 -22
View File
@@ -23,30 +23,17 @@ from PyQt5.QtWidgets import (
QShortcut, QMessageBox, QProgressDialog, QDialog QShortcut, QMessageBox, QProgressDialog, QDialog
) )
from nw.gui.mainmenu import GuiMainMenu from nw.gui import (
from nw.gui.statusbar import GuiMainStatus GuiMainMenu, GuiMainStatus, GuiDocTree, GuiDocEditor, GuiDocViewer,
from nw.gui.elements.doctree import GuiDocTree GuiDocDetails, GuiSearchBar, GuiNoticeBar, GuiDocViewDetails,
from nw.gui.elements.doceditor import GuiDocEditor GuiConfigEditor, GuiProjectEditor, GuiExport, GuiItemEditor,
from nw.gui.elements.docviewer import GuiDocViewer GuiTimeLineView, GuiSessionLogView
from nw.gui.elements.docdetails import GuiDocDetails )
from nw.gui.elements.searchbar import GuiSearchBar from nw.constants import nwFiles
from nw.gui.elements.noticebar import GuiNoticeBar from nw.project import NWProject, NWDoc, NWItem, NWIndex, NWBackup
from nw.gui.elements.viewdetails import GuiDocViewDetails from nw.tools import countWords
from nw.gui.dialogs.configeditor import GuiConfigEditor
from nw.gui.dialogs.projecteditor import GuiProjectEditor
from nw.gui.dialogs.export import GuiExport
from nw.gui.dialogs.itemeditor import GuiItemEditor
from nw.gui.dialogs.timelineview import GuiTimeLineView
from nw.gui.dialogs.sessionlog import GuiSessionLogView
from nw.project.project import NWProject
from nw.project.document import NWDoc
from nw.project.item import NWItem
from nw.project.index import NWIndex
from nw.project.backup import NWBackup
from nw.tools.wordcount import countWords
from nw.theme import Theme from nw.theme import Theme
from nw.enum import nwItemType, nwAlert from nw.enum import nwItemType, nwAlert
from nw.constants import nwFiles
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+17
View File
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from nw.project.backup import NWBackup
from nw.project.document import NWDoc
from nw.project.index import NWIndex
from nw.project.item import NWItem
from nw.project.project import NWProject
from nw.project.status import NWStatus
__all__ = [
NWBackup,
NWDoc,
NWIndex,
NWItem,
NWProject,
NWStatus,
]
+1 -2
View File
@@ -17,9 +17,8 @@ import nw
from os import path from os import path
from nw.project.document import NWDoc from nw.project.document import NWDoc
from nw.enum import nwItemType, nwItemClass, nwItemLayout
from nw.constants import nwFiles, nwKeyWords from nw.constants import nwFiles, nwKeyWords
from nw.enum import nwAlert from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -17,8 +17,8 @@ from os import path, mkdir
from lxml import etree from lxml import etree
from datetime import datetime from datetime import datetime
from nw.enum import nwItemType, nwItemClass, nwItemLayout
from nw.common import checkInt from nw.common import checkInt
from nw.enum import nwItemType, nwItemClass, nwItemLayout
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+3 -3
View File
@@ -20,11 +20,11 @@ from hashlib import sha256
from datetime import datetime from datetime import datetime
from time import time from time import time
from nw.project.item import NWItem
from nw.project.status import NWStatus from nw.project.status import NWStatus
from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert from nw.project.item import NWItem
from nw.common import checkString, checkBool, checkInt
from nw.constants import nwFiles, nwConst from nw.constants import nwFiles, nwConst
from nw.common import checkString, checkBool, checkInt
from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -15,8 +15,8 @@ import nw
from lxml import etree from lxml import etree
from nw.enum import nwItemClass
from nw.common import checkInt from nw.common import checkInt
from nw.enum import nwItemClass
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+17
View File
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from nw.tools.analyse import TextAnalysis
from nw.tools.optlaststate import OptLastState
from nw.tools.spellcheck import NWSpellCheck
from nw.tools.spellenchant import NWSpellEnchant
from nw.tools.translate import numberToWord
from nw.tools.wordcount import countWords
__all__ = [
TextAnalysis,
OptLastState,
NWSpellCheck,
NWSpellEnchant,
numberToWord,
countWords,
]