Move enum and constants to the root source folder
This commit is contained in:
+2
-3
@@ -31,9 +31,8 @@ from datetime import datetime
|
||||
from PyQt5.QtWidgets import qApp
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from nw.constants import (
|
||||
nwConst, nwUnicode, nwItemClass, nwItemType, nwItemLayout
|
||||
)
|
||||
from nw.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
from nw.constants import nwConst, nwUnicode
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+2
-2
@@ -39,9 +39,9 @@ from PyQt5.QtCore import (
|
||||
QTranslator
|
||||
)
|
||||
|
||||
from nw.constants import nwConst, nwFiles, nwUnicode
|
||||
from nw.common import splitVersionNumber, formatTimeStamp
|
||||
from nw.error import logException
|
||||
from nw.common import splitVersionNumber, formatTimeStamp
|
||||
from nw.constants import nwConst, nwFiles, nwUnicode
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -26,9 +26,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP
|
||||
|
||||
from nw.constants.enum import (
|
||||
nwItemClass, nwItemLayout, nwItemType, nwOutline
|
||||
)
|
||||
from nw.enum import nwItemClass, nwItemLayout, nwItemType, nwOutline
|
||||
|
||||
def trConst(tString):
|
||||
"""Wrapper function for locally translating constants.
|
||||
@@ -1,30 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from nw.constants.constants import (
|
||||
trConst, nwConst, nwLists, nwRegEx, nwFiles, nwKeyWords, nwLabels,
|
||||
nwQuotes, nwUnicode, nwHtmlUnicode
|
||||
)
|
||||
from nw.constants.enum import (
|
||||
nwAlert, nwDocAction, nwItemClass, nwItemLayout, nwItemType, nwOutline,
|
||||
nwDocInsert, nwWidget
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"trConst",
|
||||
"nwConst",
|
||||
"nwLists",
|
||||
"nwRegEx",
|
||||
"nwFiles",
|
||||
"nwKeyWords",
|
||||
"nwLabels",
|
||||
"nwQuotes",
|
||||
"nwUnicode",
|
||||
"nwHtmlUnicode",
|
||||
"nwAlert",
|
||||
"nwDocAction",
|
||||
"nwItemClass",
|
||||
"nwItemLayout",
|
||||
"nwItemType",
|
||||
"nwOutline",
|
||||
"nwDocInsert",
|
||||
"nwWidget",
|
||||
]
|
||||
+1
-2
@@ -31,9 +31,8 @@ from functools import partial
|
||||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from nw.constants import nwAlert
|
||||
from nw.enum import nwAlert, nwItemLayout, nwItemClass
|
||||
from nw.common import isHandle
|
||||
from nw.constants import nwItemLayout, nwItemClass
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+3
-5
@@ -32,12 +32,10 @@ import os
|
||||
|
||||
from time import time
|
||||
|
||||
from nw.constants import (
|
||||
nwFiles, nwKeyWords, nwItemType, nwItemClass, nwItemLayout, nwAlert,
|
||||
nwUnicode
|
||||
)
|
||||
from nw.core.document import NWDoc
|
||||
from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert
|
||||
from nw.common import isHandle, isTitleTag, isItemClass, isItemLayout
|
||||
from nw.constants import nwFiles, nwKeyWords, nwUnicode
|
||||
from nw.core.document import NWDoc
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+2
-4
@@ -28,10 +28,8 @@ import logging
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from nw.constants import nwItemType, nwItemClass, nwItemLayout
|
||||
from nw.common import (
|
||||
checkInt, isHandle, isItemClass, isItemLayout, isItemType
|
||||
)
|
||||
from nw.enum import nwItemType, nwItemClass, nwItemLayout
|
||||
from nw.common import checkInt, isHandle, isItemClass, isItemLayout, isItemType
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+2
-3
@@ -45,9 +45,8 @@ from nw.common import (
|
||||
checkString, checkBool, checkInt, isHandle, formatTimeStamp,
|
||||
makeFileNameSafe, hexToInt
|
||||
)
|
||||
from nw.constants import (
|
||||
trConst, nwFiles, nwItemType, nwItemClass, nwItemLayout, nwLabels, nwAlert
|
||||
)
|
||||
from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert
|
||||
from nw.constants import trConst, nwFiles, nwLabels
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
import logging
|
||||
|
||||
from nw.core.tokenizer import Tokenizer
|
||||
from nw.constants import nwLabels, nwKeyWords, nwHtmlUnicode
|
||||
from nw.constants import nwKeyWords, nwLabels, nwHtmlUnicode
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -32,9 +32,10 @@ from functools import partial
|
||||
|
||||
from PyQt5.QtCore import QCoreApplication, QRegularExpression
|
||||
|
||||
from nw.core.document import NWDoc
|
||||
from nw.enum import nwItemLayout, nwItemType
|
||||
from nw.common import numberToRoman
|
||||
from nw.constants import nwConst, nwUnicode, nwItemLayout, nwItemType, nwRegEx
|
||||
from nw.constants import nwConst, nwRegEx, nwUnicode
|
||||
from nw.core.document import NWDoc
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+1
-1
@@ -26,8 +26,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import logging
|
||||
|
||||
from nw.core.tokenizer import Tokenizer
|
||||
from nw.constants import nwLabels
|
||||
from nw.core.tokenizer import Tokenizer
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+2
-2
@@ -29,11 +29,11 @@ import logging
|
||||
|
||||
from lxml import etree
|
||||
from hashlib import sha256
|
||||
from datetime import datetime
|
||||
from zipfile import ZipFile
|
||||
from datetime import datetime
|
||||
|
||||
from nw.constants import nwKeyWords, nwLabels
|
||||
from nw.core.tokenizer import Tokenizer
|
||||
from nw.constants import nwLabels, nwKeyWords
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+4
-5
@@ -29,14 +29,13 @@ import logging
|
||||
import os
|
||||
|
||||
from lxml import etree
|
||||
from hashlib import sha256
|
||||
from time import time
|
||||
from hashlib import sha256
|
||||
|
||||
from nw.core.item import NWItem
|
||||
from nw.enum import nwItemType, nwItemClass, nwItemLayout
|
||||
from nw.common import checkHandle
|
||||
from nw.constants import (
|
||||
nwFiles, nwItemType, nwItemClass, nwItemLayout, nwConst, nwLists
|
||||
)
|
||||
from nw.constants import nwConst, nwLists, nwFiles
|
||||
from nw.core.item import NWItem
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+4
-5
@@ -44,12 +44,11 @@ from PyQt5.QtWidgets import (
|
||||
QSizePolicy, QDoubleSpinBox, QComboBox
|
||||
)
|
||||
|
||||
from nw.common import fuzzyTime, makeFileNameSafe
|
||||
from nw.gui.custom import QSwitch
|
||||
from nw.core import ToHtml, ToOdt, ToMarkdown
|
||||
from nw.constants import (
|
||||
nwConst, nwAlert, nwFiles, nwItemType, nwItemLayout, nwItemClass
|
||||
)
|
||||
from nw.enum import nwAlert, nwItemType, nwItemLayout, nwItemClass
|
||||
from nw.common import fuzzyTime, makeFileNameSafe
|
||||
from nw.constants import nwConst, nwFiles
|
||||
from nw.gui.custom import QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ from PyQt5.QtWidgets import (
|
||||
QLineEdit
|
||||
)
|
||||
|
||||
from nw.constants import trConst, nwUnicode, nwQuotes
|
||||
from nw.constants import trConst, nwQuotes, nwUnicode
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+3
-5
@@ -50,12 +50,10 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from nw.core import NWDoc, NWSpellSimple, countWords
|
||||
from nw.gui.dochighlight import GuiDocHighlighter
|
||||
from nw.enum import nwAlert, nwDocAction, nwDocInsert, nwItemClass
|
||||
from nw.common import transferCase
|
||||
from nw.constants import (
|
||||
trConst, nwConst, nwAlert, nwUnicode, nwDocAction, nwDocInsert,
|
||||
nwItemClass, nwKeyWords, nwLabels
|
||||
)
|
||||
from nw.constants import nwConst, trConst, nwKeyWords, nwLabels, nwUnicode
|
||||
from nw.gui.dochighlight import GuiDocHighlighter
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ from PyQt5.QtGui import (
|
||||
QColor, QTextCharFormat, QFont, QSyntaxHighlighter, QBrush
|
||||
)
|
||||
|
||||
from nw.constants import nwUnicode, nwRegEx
|
||||
from nw.constants import nwRegEx, nwUnicode
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+2
-2
@@ -33,9 +33,9 @@ from PyQt5.QtWidgets import (
|
||||
QListWidgetItem, QDialogButtonBox
|
||||
)
|
||||
|
||||
from nw.constants import nwAlert, nwItemType
|
||||
from nw.gui.custom import QHelpLabel
|
||||
from nw.core import NWDoc
|
||||
from nw.enum import nwAlert, nwItemType
|
||||
from nw.gui.custom import QHelpLabel
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+2
-3
@@ -34,10 +34,9 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from nw.core import NWDoc
|
||||
from nw.enum import nwAlert, nwItemType, nwItemClass, nwItemLayout
|
||||
from nw.constants import nwConst
|
||||
from nw.gui.custom import QHelpLabel
|
||||
from nw.constants import (
|
||||
nwAlert, nwItemType, nwItemClass, nwItemLayout, nwConst
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+2
-1
@@ -41,7 +41,8 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from nw.core import ToHtml
|
||||
from nw.constants import nwAlert, nwItemType, nwDocAction, nwUnicode
|
||||
from nw.enum import nwAlert, nwItemType, nwDocAction
|
||||
from nw.constants import nwUnicode
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -31,9 +31,8 @@ from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QFont, QPixmap
|
||||
from PyQt5.QtWidgets import QWidget, QGridLayout, QLabel
|
||||
|
||||
from nw.constants import (
|
||||
trConst, nwLabels, nwItemClass, nwItemType, nwItemLayout
|
||||
)
|
||||
from nw.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
from nw.constants import trConst, nwLabels
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -33,8 +33,9 @@ from PyQt5.QtWidgets import (
|
||||
QDialogButtonBox
|
||||
)
|
||||
|
||||
from nw.enum import nwItemLayout, nwItemType
|
||||
from nw.constants import trConst, nwLists, nwLabels
|
||||
from nw.gui.custom import QSwitch
|
||||
from nw.constants import trConst, nwLabels, nwItemLayout, nwItemType, nwLists
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+2
-4
@@ -31,10 +31,8 @@ from PyQt5.QtCore import QUrl, QProcess
|
||||
from PyQt5.QtGui import QDesktopServices
|
||||
from PyQt5.QtWidgets import QMenuBar, QAction
|
||||
|
||||
from nw.constants import (
|
||||
trConst, nwItemType, nwItemClass, nwDocAction, nwDocInsert, nwKeyWords,
|
||||
nwLabels, nwUnicode, nwWidget
|
||||
)
|
||||
from nw.enum import nwItemType, nwItemClass, nwDocAction, nwDocInsert, nwWidget
|
||||
from nw.constants import trConst, nwKeyWords, nwLabels, nwUnicode
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+1
-1
@@ -32,8 +32,8 @@ from time import time
|
||||
from PyQt5.QtCore import Qt, QSize
|
||||
from PyQt5.QtWidgets import QTreeWidget, QTreeWidgetItem, QAbstractItemView
|
||||
|
||||
from nw.constants import nwKeyWords
|
||||
from nw.common import checkInt
|
||||
from nw.constants import nwKeyWords
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+2
-1
@@ -34,7 +34,8 @@ from PyQt5.QtWidgets import (
|
||||
QTreeWidget, QTreeWidgetItem, QMenu, QAction, QAbstractItemView
|
||||
)
|
||||
|
||||
from nw.constants import trConst, nwKeyWords, nwLabels, nwOutline
|
||||
from nw.enum import nwOutline
|
||||
from nw.constants import trConst, nwKeyWords, nwLabels
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ from PyQt5.QtWidgets import (
|
||||
QScrollArea, QWidget, QGridLayout, QHBoxLayout, QGroupBox, QLabel
|
||||
)
|
||||
|
||||
from nw.constants import trConst, nwLabels, nwKeyWords
|
||||
from nw.common import checkInt
|
||||
from nw.constants import trConst, nwKeyWords, nwLabels
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -35,9 +35,10 @@ from PyQt5.QtWidgets import (
|
||||
QLineEdit, QFileDialog, QFontDialog, QDoubleSpinBox
|
||||
)
|
||||
|
||||
from nw.gui.custom import QSwitch, QConfigLayout, PagedDialog, QuotesDialog
|
||||
from nw.core import NWSpellSimple, NWSpellEnchant
|
||||
from nw.constants import nwConst, nwAlert
|
||||
from nw.enum import nwAlert
|
||||
from nw.constants import nwConst
|
||||
from nw.gui.custom import QSwitch, QConfigLayout, PagedDialog, QuotesDialog
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ from PyQt5.QtWidgets import (
|
||||
QLabel, QSpinBox, QGridLayout, QHBoxLayout, QLineEdit, QAbstractItemView
|
||||
)
|
||||
|
||||
from nw.gui.custom import PagedDialog, QSwitch
|
||||
from nw.constants import nwUnicode
|
||||
from nw.common import numberToRoman
|
||||
from nw.constants import nwUnicode
|
||||
from nw.gui.custom import PagedDialog, QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ from PyQt5.QtWidgets import (
|
||||
QComboBox
|
||||
)
|
||||
|
||||
from nw.constants import nwAlert
|
||||
from nw.enum import nwAlert
|
||||
from nw.gui.custom import QSwitch, PagedDialog, QConfigLayout
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
+2
-4
@@ -37,10 +37,8 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from nw.core import NWDoc
|
||||
from nw.constants import (
|
||||
trConst, nwLabels, nwItemType, nwItemClass, nwItemLayout, nwAlert,
|
||||
nwConst, nwLists
|
||||
)
|
||||
from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert
|
||||
from nw.constants import nwConst, trConst, nwLists, nwLabels
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -35,8 +35,9 @@ from PyQt5.QtWidgets import (
|
||||
QGroupBox, QGridLayout, QSpinBox
|
||||
)
|
||||
|
||||
from nw.enum import nwItemClass
|
||||
from nw.common import makeFileNameSafe
|
||||
from nw.constants import trConst, nwLabels, nwItemClass
|
||||
from nw.constants import trConst, nwLabels
|
||||
from nw.gui.custom import QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ from PyQt5.QtGui import (
|
||||
QPalette, QColor, QIcon, QFont, QFontMetrics, QFontDatabase, QPixmap
|
||||
)
|
||||
|
||||
from nw.constants import nwAlert
|
||||
from nw.enum import nwAlert
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+2
-1
@@ -34,7 +34,8 @@ from PyQt5.QtWidgets import (
|
||||
QAbstractItemView, QPushButton, QLineEdit, QLabel
|
||||
)
|
||||
|
||||
from nw.constants import nwFiles, nwAlert
|
||||
from nw.enum import nwAlert
|
||||
from nw.constants import nwFiles
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -38,8 +38,9 @@ from PyQt5.QtWidgets import (
|
||||
QLabel, QGroupBox, QMenu, QAction, QFileDialog, QSpinBox, QHBoxLayout
|
||||
)
|
||||
|
||||
from nw.enum import nwAlert
|
||||
from nw.common import formatTime, checkInt
|
||||
from nw.constants import nwConst, nwFiles, nwAlert
|
||||
from nw.constants import nwConst, nwFiles
|
||||
from nw.gui.custom import QSwitch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
+2
-1
@@ -46,8 +46,9 @@ from nw.gui import (
|
||||
GuiProjectTree, GuiProjectWizard, GuiTheme, GuiWordList, GuiWritingStats
|
||||
)
|
||||
from nw.core import NWProject, NWDoc, NWIndex
|
||||
from nw.constants import nwItemType, nwItemClass, nwAlert, nwLists, nwWidget
|
||||
from nw.enum import nwItemType, nwItemClass, nwAlert, nwWidget
|
||||
from nw.common import getGuiItem, hexToInt
|
||||
from nw.constants import nwLists
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user