Remove all END Class comments
This commit is contained in:
@@ -242,5 +242,3 @@ def main(sysArgs: list | None = None) -> GuiMain | None:
|
||||
sys.exit(nwApp.exec())
|
||||
|
||||
return None
|
||||
|
||||
# END Function main
|
||||
|
||||
@@ -603,5 +603,3 @@ class NWConfigParser(ConfigParser):
|
||||
for i in range(min(len(data), len(result))):
|
||||
result[i] = checkInt(data[i].strip(), result[i])
|
||||
return result
|
||||
|
||||
# END Class NWConfigParser
|
||||
|
||||
@@ -24,24 +24,24 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from time import time
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from time import time
|
||||
|
||||
from PyQt5.QtGui import QFontDatabase
|
||||
from PyQt5.QtCore import (
|
||||
PYQT_VERSION, PYQT_VERSION_STR, QT_VERSION, QT_VERSION_STR, QLibraryInfo,
|
||||
QLocale, QStandardPaths, QSysInfo, QTranslator
|
||||
)
|
||||
from PyQt5.QtGui import QFontDatabase
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
|
||||
from novelwriter.error import formatException, logException
|
||||
from novelwriter.common import NWConfigParser, checkInt, checkPath, formatTimeStamp
|
||||
from novelwriter.constants import nwFiles, nwUnicode
|
||||
from novelwriter.error import formatException, logException
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -787,8 +787,6 @@ class Config:
|
||||
logger.debug("Checking package 'pyenchant': OK")
|
||||
return
|
||||
|
||||
# END Class Config
|
||||
|
||||
|
||||
class RecentProjects:
|
||||
|
||||
@@ -857,5 +855,3 @@ class RecentProjects:
|
||||
logger.debug("Removed recent: %s", path)
|
||||
self.saveCache()
|
||||
return
|
||||
|
||||
# END Class RecentProjects
|
||||
|
||||
@@ -60,8 +60,6 @@ class nwConst:
|
||||
# Dialogs
|
||||
DLG_FINISHED = 2
|
||||
|
||||
# END Class nwConst
|
||||
|
||||
|
||||
class nwRegEx:
|
||||
|
||||
@@ -71,8 +69,6 @@ class nwRegEx:
|
||||
FMT_SC = r"(?i)(?<!\\)(\[[\/\!]?(?:i|b|s|u|m|sup|sub)\])"
|
||||
FMT_SV = r"(?<!\\)(\[(?i)(?:footnote):)(.+?)(?<!\\)(\])"
|
||||
|
||||
# END Class nwRegEx
|
||||
|
||||
|
||||
class nwShortcode:
|
||||
|
||||
@@ -98,16 +94,12 @@ class nwShortcode:
|
||||
nwComment.COMMENT: "[comment:{0}]",
|
||||
}
|
||||
|
||||
# END Class nwShortcode
|
||||
|
||||
|
||||
class nwHeaders:
|
||||
|
||||
H_VALID = ("H0", "H1", "H2", "H3", "H4")
|
||||
H_LEVEL = {"H0": 0, "H1": 1, "H2": 2, "H3": 3, "H4": 4}
|
||||
|
||||
# END Class nwHeaders
|
||||
|
||||
|
||||
class nwFiles:
|
||||
|
||||
@@ -127,8 +119,6 @@ class nwFiles:
|
||||
DICT_FILE = "userdict.json"
|
||||
SESS_FILE = "sessions.jsonl"
|
||||
|
||||
# END Class nwFiles
|
||||
|
||||
|
||||
class nwKeyWords:
|
||||
|
||||
@@ -162,8 +152,6 @@ class nwKeyWords:
|
||||
CUSTOM_KEY: nwItemClass.CUSTOM,
|
||||
}
|
||||
|
||||
# END Class nwKeyWords
|
||||
|
||||
|
||||
class nwLists:
|
||||
|
||||
@@ -177,8 +165,6 @@ class nwLists:
|
||||
nwItemClass.CUSTOM,
|
||||
]
|
||||
|
||||
# END Class nwLists
|
||||
|
||||
|
||||
class nwLabels:
|
||||
|
||||
@@ -339,8 +325,6 @@ class nwLabels:
|
||||
"Custom": (-1.0, -1.0),
|
||||
}
|
||||
|
||||
# END Class nwLabels
|
||||
|
||||
|
||||
class nwHeadFmt:
|
||||
|
||||
@@ -366,8 +350,6 @@ class nwHeadFmt:
|
||||
ODT_PAGE = "{Page}"
|
||||
ODT_AUTO = "{Project} / {Author} / {Page}"
|
||||
|
||||
# END Class nwHeadFmt
|
||||
|
||||
|
||||
class nwQuotes:
|
||||
"""Allowed quotation marks.
|
||||
@@ -398,8 +380,6 @@ class nwQuotes:
|
||||
"\u300f": QT_TRANSLATE_NOOP("Constant", "Right white corner bracket"),
|
||||
}
|
||||
|
||||
# END Class nwQuotes
|
||||
|
||||
|
||||
class nwUnicode:
|
||||
"""Supported unicode character constants and their HTML equivalents."""
|
||||
@@ -534,8 +514,6 @@ class nwUnicode:
|
||||
H_LTRI = "◀"
|
||||
H_LTRIS = "◂"
|
||||
|
||||
# END Class nwUnicode
|
||||
|
||||
|
||||
class nwHtmlUnicode():
|
||||
|
||||
@@ -591,5 +569,3 @@ class nwHtmlUnicode():
|
||||
nwUnicode.U_TIMES: nwUnicode.H_TIMES,
|
||||
nwUnicode.U_DIVIDE: nwUnicode.H_DIVIDE,
|
||||
}
|
||||
|
||||
# END Class nwHtmlUnicode
|
||||
|
||||
@@ -488,8 +488,6 @@ class BuildSettings:
|
||||
|
||||
return
|
||||
|
||||
# END Class BuildSettings
|
||||
|
||||
|
||||
class BuildCollection:
|
||||
"""Core: Build Collection Class
|
||||
@@ -637,5 +635,3 @@ class BuildCollection:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
# END Class BuildCollection
|
||||
|
||||
@@ -129,8 +129,6 @@ class DocMerger:
|
||||
|
||||
return status
|
||||
|
||||
# END Class DocMerger
|
||||
|
||||
|
||||
class DocSplitter:
|
||||
"""Document tool for splitting a document into a set of new
|
||||
@@ -257,8 +255,6 @@ class DocSplitter:
|
||||
|
||||
return
|
||||
|
||||
# END Class DocSplitter
|
||||
|
||||
|
||||
class DocDuplicator:
|
||||
"""A class that will duplicate all documents and folders starting
|
||||
@@ -297,8 +293,6 @@ class DocDuplicator:
|
||||
nHandle = None
|
||||
return
|
||||
|
||||
# END Class DocDuplicator
|
||||
|
||||
|
||||
class DocSearch:
|
||||
|
||||
@@ -375,8 +369,6 @@ class DocSearch:
|
||||
search = f"(?:^|\\b){search}(?:$|\\b)"
|
||||
return search
|
||||
|
||||
# END Class DocSearch
|
||||
|
||||
|
||||
class ProjectBuilder:
|
||||
"""A class to build a new project from a set of user-defined
|
||||
@@ -609,5 +601,3 @@ class ProjectBuilder:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
# END Class ProjectBuilder
|
||||
|
||||
@@ -405,5 +405,3 @@ class NWBuildDocument:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
# END Class NWBuildDocument
|
||||
|
||||
@@ -26,14 +26,14 @@ from __future__ import annotations
|
||||
import hashlib
|
||||
import logging
|
||||
|
||||
from pathlib import Path
|
||||
from time import time
|
||||
from typing import TYPE_CHECKING
|
||||
from pathlib import Path
|
||||
|
||||
from novelwriter.enum import nwItemLayout, nwItemClass
|
||||
from novelwriter.error import formatException, logException
|
||||
from novelwriter.common import formatTimeStamp, isHandle
|
||||
from novelwriter.core.item import NWItem
|
||||
from novelwriter.enum import nwItemClass, nwItemLayout
|
||||
from novelwriter.error import formatException, logException
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from novelwriter.core.project import NWProject
|
||||
@@ -359,5 +359,3 @@ class NWDocument:
|
||||
logger.debug("Unknown meta data: '%s'", metaLine.strip())
|
||||
|
||||
return
|
||||
|
||||
# END Class NWDocument
|
||||
|
||||
@@ -707,8 +707,6 @@ class NWIndex:
|
||||
return tName, tClass, iItem, None if iItem is None else iItem[tHeading]
|
||||
return "", "", None, None
|
||||
|
||||
# END Class NWIndex
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
# The Tags Index Object
|
||||
@@ -832,8 +830,6 @@ class TagsIndex:
|
||||
|
||||
return
|
||||
|
||||
# END Class TagsIndex
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
# The Item Index Objects
|
||||
@@ -1014,8 +1010,6 @@ class ItemIndex:
|
||||
|
||||
return
|
||||
|
||||
# END Class ItemIndex
|
||||
|
||||
|
||||
class IndexItem:
|
||||
"""Core: Single Index Item Class
|
||||
@@ -1176,8 +1170,6 @@ class IndexItem:
|
||||
|
||||
return
|
||||
|
||||
# END Class IndexItem
|
||||
|
||||
|
||||
class IndexHeading:
|
||||
"""Core: Single Index Heading Class
|
||||
@@ -1353,13 +1345,10 @@ class IndexHeading:
|
||||
raise ValueError("The itemIndex contains an invalid reference type")
|
||||
return
|
||||
|
||||
# END Class IndexHeading
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
# Text Processing Functions
|
||||
# =============================================================================================== #
|
||||
|
||||
MODIFIERS = {
|
||||
"synopsis": nwComment.SYNOPSIS,
|
||||
"short": nwComment.SHORT,
|
||||
|
||||
@@ -29,11 +29,12 @@ from typing import TYPE_CHECKING, Any
|
||||
|
||||
from PyQt5.QtGui import QIcon
|
||||
|
||||
from novelwriter.enum import nwItemType, nwItemClass, nwItemLayout
|
||||
from novelwriter.common import (
|
||||
checkInt, isHandle, isItemClass, isItemLayout, isItemType, simplified, yesNo
|
||||
checkInt, isHandle, isItemClass, isItemLayout, isItemType, simplified,
|
||||
yesNo
|
||||
)
|
||||
from novelwriter.constants import nwHeaders, nwLabels, trConst
|
||||
from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from novelwriter.core.project import NWProject
|
||||
@@ -557,5 +558,3 @@ class NWItem:
|
||||
"""Save the initial word count."""
|
||||
self._initCount = self._wordCount
|
||||
return
|
||||
|
||||
# END Class NWItem
|
||||
|
||||
@@ -28,12 +28,12 @@ import json
|
||||
import logging
|
||||
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
|
||||
from novelwriter.error import logException
|
||||
from novelwriter.common import checkBool, checkFloat, checkInt, checkString, jsonEncode
|
||||
from novelwriter.constants import nwFiles
|
||||
from novelwriter.error import logException
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from novelwriter.core.project import NWProject
|
||||
@@ -218,5 +218,3 @@ class OptionState:
|
||||
if value in lookup.__members__:
|
||||
return lookup[value]
|
||||
return default
|
||||
|
||||
# END Class OptionState
|
||||
|
||||
@@ -35,11 +35,12 @@ from typing import TYPE_CHECKING
|
||||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from novelwriter import CONFIG, SHARED, __version__, __hexversion__
|
||||
from novelwriter import CONFIG, SHARED, __hexversion__, __version__
|
||||
from novelwriter.common import (
|
||||
checkStringNone, formatInt, formatTimeStamp, getFileSize, hexToInt, makeFileNameSafe, minmax
|
||||
checkStringNone, formatInt, formatTimeStamp, getFileSize, hexToInt,
|
||||
makeFileNameSafe, minmax
|
||||
)
|
||||
from novelwriter.constants import trConst, nwLabels
|
||||
from novelwriter.constants import nwLabels, trConst
|
||||
from novelwriter.core.index import NWIndex
|
||||
from novelwriter.core.options import OptionState
|
||||
from novelwriter.core.projectdata import NWProjectData
|
||||
@@ -47,7 +48,7 @@ from novelwriter.core.projectxml import ProjectXMLReader, ProjectXMLWriter, XMLR
|
||||
from novelwriter.core.sessions import NWSessionLog
|
||||
from novelwriter.core.storage import NWStorage, NWStorageOpen
|
||||
from novelwriter.core.tree import NWTree
|
||||
from novelwriter.enum import nwItemType, nwItemClass, nwItemLayout
|
||||
from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType
|
||||
from novelwriter.error import logException
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
@@ -595,5 +596,3 @@ class NWProject:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
# END Class NWProject
|
||||
|
||||
@@ -23,8 +23,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import uuid
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
@@ -322,5 +322,3 @@ class NWProjectData:
|
||||
self._autoReplace[key] = simplified(entry)
|
||||
self._project.setProjectChanged(True)
|
||||
return
|
||||
|
||||
# END Class NWProjectData
|
||||
|
||||
@@ -29,19 +29,19 @@ import logging
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
from time import time
|
||||
from typing import TYPE_CHECKING
|
||||
from pathlib import Path
|
||||
|
||||
from novelwriter import __version__, __hexversion__
|
||||
from novelwriter import __hexversion__, __version__
|
||||
from novelwriter.common import (
|
||||
checkBool, checkInt, checkString, checkStringNone, formatTimeStamp,
|
||||
hexToInt, simplified, xmlIndent, yesNo
|
||||
)
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from novelwriter.core.status import NWStatus
|
||||
from novelwriter.core.projectdata import NWProjectData
|
||||
from novelwriter.core.status import NWStatus
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -70,8 +70,6 @@ class XMLReadState(Enum):
|
||||
PARSED_OK = 5
|
||||
WAS_LEGACY = 6
|
||||
|
||||
# END Class XMLReadState
|
||||
|
||||
|
||||
class ProjectXMLReader:
|
||||
"""Core: Project XML Reader
|
||||
@@ -458,8 +456,6 @@ class ProjectXMLReader:
|
||||
"""
|
||||
return {xNode.tag: checkString(xNode.text, "") for xNode in xItem}
|
||||
|
||||
# END Class ProjectXMLReader
|
||||
|
||||
|
||||
class ProjectXMLWriter:
|
||||
"""Core: Project XML Writer
|
||||
@@ -579,5 +575,3 @@ class ProjectXMLWriter:
|
||||
xEntry = ET.SubElement(xItem, "entry", attrib={"key": key})
|
||||
xEntry.text = str(value) or ""
|
||||
return
|
||||
|
||||
# END Class ProjectXMLWriter
|
||||
|
||||
@@ -26,14 +26,14 @@ from __future__ import annotations
|
||||
import json
|
||||
import logging
|
||||
|
||||
from collections.abc import Iterable
|
||||
from pathlib import Path
|
||||
from time import time
|
||||
from typing import TYPE_CHECKING
|
||||
from pathlib import Path
|
||||
from collections.abc import Iterable
|
||||
|
||||
from novelwriter.error import logException
|
||||
from novelwriter.common import formatTimeStamp
|
||||
from novelwriter.constants import nwFiles
|
||||
from novelwriter.error import logException
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from novelwriter.core.project import NWProject
|
||||
@@ -135,5 +135,3 @@ class NWSessionLog:
|
||||
"novel": novel, "notes": notes, "idle": idle,
|
||||
})
|
||||
return f"{data}\n"
|
||||
|
||||
# END Class NWSessionLog
|
||||
|
||||
@@ -27,14 +27,14 @@ from __future__ import annotations
|
||||
import json
|
||||
import logging
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from pathlib import Path
|
||||
from collections.abc import Iterator
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from PyQt5.QtCore import QLocale
|
||||
|
||||
from novelwriter.error import logException
|
||||
from novelwriter.constants import nwFiles
|
||||
from novelwriter.error import logException
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from novelwriter.core.project import NWProject
|
||||
@@ -164,11 +164,10 @@ class NWSpellEnchant:
|
||||
name = ""
|
||||
return tag, name
|
||||
|
||||
# END Class NWSpellEnchant
|
||||
|
||||
|
||||
class FakeEnchant:
|
||||
"""Fallback for when Enchant is selected, but not installed."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
|
||||
class FakeProvider:
|
||||
@@ -188,8 +187,6 @@ class FakeEnchant:
|
||||
def add_to_session(self, word: str) -> None:
|
||||
return
|
||||
|
||||
# END Class FakeEnchant
|
||||
|
||||
|
||||
class UserDictionary:
|
||||
|
||||
@@ -240,5 +237,3 @@ class UserDictionary:
|
||||
logger.error("Failed to save user dictionary")
|
||||
logException()
|
||||
return
|
||||
|
||||
# END Class UserDictionary
|
||||
|
||||
@@ -32,7 +32,7 @@ from collections.abc import Iterable
|
||||
from typing import TYPE_CHECKING, Literal
|
||||
|
||||
from PyQt5.QtCore import QPointF, Qt
|
||||
from PyQt5.QtGui import QIcon, QPainter, QPainterPath, QPixmap, QColor, QPolygonF
|
||||
from PyQt5.QtGui import QColor, QIcon, QPainter, QPainterPath, QPixmap, QPolygonF
|
||||
|
||||
from novelwriter import SHARED
|
||||
from novelwriter.common import simplified
|
||||
@@ -62,8 +62,6 @@ class StatusEntry:
|
||||
cls.icon = QIcon(source.icon)
|
||||
return cls
|
||||
|
||||
# END Class StatusEntry
|
||||
|
||||
|
||||
NO_ENTRY = StatusEntry("", QColor(0, 0, 0), nwStatusShape.SQUARE, QIcon(), 0)
|
||||
|
||||
@@ -221,8 +219,6 @@ class NWStatus:
|
||||
"""Check key is valid, and if not, generate one."""
|
||||
return key if self._isKey(key) else self._newKey()
|
||||
|
||||
# END Class NWStatus
|
||||
|
||||
|
||||
class _ShapeCache:
|
||||
|
||||
@@ -329,8 +325,6 @@ class _ShapeCache:
|
||||
|
||||
return path
|
||||
|
||||
# END Class _ShapeCache
|
||||
|
||||
|
||||
# Create Singleton
|
||||
_SHAPES = _ShapeCache()
|
||||
|
||||
@@ -391,8 +391,6 @@ class NWStorage:
|
||||
self._lockedBy = None
|
||||
return True
|
||||
|
||||
# END Class NWStorage
|
||||
|
||||
|
||||
class _LegacyStorage:
|
||||
"""Core: Legacy Storage Converter Utils
|
||||
@@ -590,5 +588,3 @@ class _LegacyStorage:
|
||||
logException()
|
||||
|
||||
return
|
||||
|
||||
# END Class _LegacyStorage
|
||||
|
||||
@@ -536,5 +536,3 @@ class ToHtml(Tokenizer):
|
||||
)
|
||||
|
||||
return bits[0][1:], result
|
||||
|
||||
# END Class ToHtml
|
||||
|
||||
@@ -1045,8 +1045,6 @@ class Tokenizer(ABC):
|
||||
|
||||
return result, formats
|
||||
|
||||
# END Class Tokenizer
|
||||
|
||||
|
||||
class HeadingFormatter:
|
||||
|
||||
@@ -1116,5 +1114,3 @@ class HeadingFormatter:
|
||||
hFormat = hFormat.replace(nwHeadFmt.CHAR_FOCUS, fText)
|
||||
|
||||
return hFormat
|
||||
|
||||
# END Class HeadingFormatter
|
||||
|
||||
@@ -272,5 +272,3 @@ class ToMarkdown(Tokenizer):
|
||||
result += " \n" if style & self.A_Z_BTMMRG else "\n\n"
|
||||
|
||||
return result
|
||||
|
||||
# END Class ToMarkdown
|
||||
|
||||
@@ -1079,8 +1079,6 @@ class ToOdt(Tokenizer):
|
||||
|
||||
return
|
||||
|
||||
# END Class ToOdt
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
# Auto-Style Classes
|
||||
@@ -1332,8 +1330,6 @@ class ODTParagraphStyle:
|
||||
|
||||
return
|
||||
|
||||
# END Class ODTParagraphStyle
|
||||
|
||||
|
||||
class ODTTextStyle:
|
||||
"""Wrapper class for the text style setting used by the exporter.
|
||||
@@ -1457,13 +1453,10 @@ class ODTTextStyle:
|
||||
ET.SubElement(xEntry, _mkTag("style", "text-properties"), attrib=attr)
|
||||
return
|
||||
|
||||
# END Class ODTTextStyle
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
# XML Complex Element Helper Class
|
||||
# =============================================================================================== #
|
||||
|
||||
X_ROOT_TEXT = 0
|
||||
X_ROOT_TAIL = 1
|
||||
X_SPAN_TEXT = 2
|
||||
@@ -1661,5 +1654,3 @@ class XMLParagraph:
|
||||
self._chrPos += nSpaces - 1
|
||||
|
||||
return
|
||||
|
||||
# END Class XMLParagraph
|
||||
|
||||
@@ -23,18 +23,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import random
|
||||
import logging
|
||||
import random
|
||||
|
||||
from typing import TYPE_CHECKING, Literal, overload
|
||||
from pathlib import Path
|
||||
from collections.abc import Iterable, Iterator
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Literal, overload
|
||||
|
||||
from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType
|
||||
from novelwriter.error import logException
|
||||
from novelwriter.common import isHandle
|
||||
from novelwriter.constants import nwFiles
|
||||
from novelwriter.core.item import NWItem
|
||||
from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType
|
||||
from novelwriter.error import logException
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from novelwriter.core.project import NWProject
|
||||
@@ -520,5 +520,3 @@ class NWTree:
|
||||
handle = self._makeHandle()
|
||||
|
||||
return handle
|
||||
|
||||
# END Class NWTree
|
||||
|
||||
@@ -152,5 +152,3 @@ class GuiAbout(NNonBlockingDialog):
|
||||
f"QTextBrowser {{border: none; background: {baseCol};}} "
|
||||
)
|
||||
return
|
||||
|
||||
# END Class GuiAbout
|
||||
|
||||
@@ -34,8 +34,8 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
from novelwriter.extensions.configlayout import NColourLabel
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
from novelwriter.types import QtDialogCancel, QtDialogOk, QtDialogReset, QtUserRole
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -182,5 +182,3 @@ class GuiDocMerge(QDialog):
|
||||
self.listBox.addItem(newItem)
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiDocMerge
|
||||
|
||||
@@ -34,8 +34,8 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
from novelwriter.extensions.configlayout import NColourLabel
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
from novelwriter.types import QtDialogCancel, QtDialogOk, QtUserRole
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -257,5 +257,3 @@ class GuiDocSplit(QDialog):
|
||||
self.listBox.addItem(newItem)
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiDocSplit
|
||||
|
||||
@@ -94,5 +94,3 @@ class GuiEditLabel(QDialog):
|
||||
accepted = cls.result() == QDialog.DialogCode.Accepted
|
||||
cls.deleteLater()
|
||||
return label, accepted
|
||||
|
||||
# END Class GuiEditLabel
|
||||
|
||||
@@ -962,5 +962,3 @@ class GuiPreferences(QDialog):
|
||||
self.newPreferencesReady.emit(needsRestart, refreshTree, updateTheme, updateSyntax)
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiPreferences
|
||||
|
||||
@@ -29,8 +29,8 @@ import logging
|
||||
from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot
|
||||
from PyQt5.QtGui import QCloseEvent, QColor
|
||||
from PyQt5.QtWidgets import (
|
||||
QAbstractItemView, QApplication, QColorDialog, QDialog, QDialogButtonBox, QHBoxLayout,
|
||||
QLineEdit, QMenu, QStackedWidget, QToolButton, QTreeWidget,
|
||||
QAbstractItemView, QApplication, QColorDialog, QDialog, QDialogButtonBox,
|
||||
QHBoxLayout, QLineEdit, QMenu, QStackedWidget, QToolButton, QTreeWidget,
|
||||
QTreeWidgetItem, QVBoxLayout, QWidget
|
||||
)
|
||||
|
||||
@@ -227,8 +227,6 @@ class GuiProjectSettings(QDialog):
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiProjectSettings
|
||||
|
||||
|
||||
class _SettingsPage(NScrollableForm):
|
||||
|
||||
@@ -302,8 +300,6 @@ class _SettingsPage(NScrollableForm):
|
||||
|
||||
return
|
||||
|
||||
# END Class _SettingsPage
|
||||
|
||||
|
||||
class _StatusPage(NFixedPage):
|
||||
|
||||
@@ -622,8 +618,6 @@ class _StatusPage(NFixedPage):
|
||||
self.shapeButton.setIcon(self._icons[self._shape])
|
||||
return
|
||||
|
||||
# END Class _StatusPage
|
||||
|
||||
|
||||
class _ReplacePage(NFixedPage):
|
||||
|
||||
@@ -797,5 +791,3 @@ class _ReplacePage(NFixedPage):
|
||||
def _stripNotAllowed(self, key: str) -> str:
|
||||
"""Clean up the replace key string."""
|
||||
return "".join(c for c in key if c.isalnum())
|
||||
|
||||
# END Class _ReplacePage
|
||||
|
||||
@@ -25,15 +25,15 @@ from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
from PyQt5.QtGui import QFontMetrics
|
||||
from PyQt5.QtCore import QSize, pyqtSlot
|
||||
from PyQt5.QtGui import QFontMetrics
|
||||
from PyQt5.QtWidgets import (
|
||||
QDialog, QDialogButtonBox, QFrame, QHBoxLayout, QLabel, QListWidget,
|
||||
QListWidgetItem, QVBoxLayout, QWidget
|
||||
)
|
||||
|
||||
from novelwriter import CONFIG
|
||||
from novelwriter.constants import trConst, nwQuotes
|
||||
from novelwriter.constants import nwQuotes, trConst
|
||||
from novelwriter.types import QtAlignCenter, QtAlignTop, QtDialogCancel, QtDialogOk, QtUserRole
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -141,5 +141,3 @@ class GuiQuoteSelect(QDialog):
|
||||
self.previewLabel.setText(quote)
|
||||
self._selected = quote
|
||||
return
|
||||
|
||||
# END Class GuiQuoteSelect
|
||||
|
||||
@@ -253,5 +253,3 @@ class GuiWordList(QDialog):
|
||||
if (item := self.listBox.item(i)) and (word := item.text().strip()):
|
||||
result.append(word)
|
||||
return result
|
||||
|
||||
# END Class GuiWordList
|
||||
|
||||
@@ -23,17 +23,17 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import random
|
||||
import logging
|
||||
import random
|
||||
import sys
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from PyQt5.QtCore import Qt, pyqtSlot
|
||||
from PyQt5.QtGui import QFont, QFontDatabase
|
||||
from PyQt5.QtWidgets import (
|
||||
QApplication, QWidget, QDialog, QGridLayout, QStyle, QPlainTextEdit,
|
||||
QLabel, QDialogButtonBox
|
||||
QApplication, QDialog, QDialogButtonBox, QGridLayout, QLabel,
|
||||
QPlainTextEdit, QStyle, QWidget
|
||||
)
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
@@ -125,9 +125,11 @@ class NWErrorMessage(QDialog):
|
||||
error traceback.
|
||||
"""
|
||||
from traceback import format_tb
|
||||
|
||||
from PyQt5.QtCore import PYQT_VERSION_STR, QT_VERSION_STR, QSysInfo
|
||||
|
||||
from novelwriter import __version__
|
||||
from novelwriter.constants import nwConst
|
||||
from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QSysInfo
|
||||
|
||||
self.msgHead.setText(
|
||||
"<p>An unhandled error has been encountered.</p>"
|
||||
@@ -175,12 +177,11 @@ class NWErrorMessage(QDialog):
|
||||
self.close()
|
||||
return
|
||||
|
||||
# END Class NWErrorMessage
|
||||
|
||||
|
||||
def exceptionHandler(exType: type, exValue: BaseException, exTrace: TracebackType) -> None:
|
||||
"""Function to catch unhandled global exceptions."""
|
||||
from traceback import print_tb
|
||||
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
|
||||
logger.critical("%s: %s", exType.__name__, str(exValue))
|
||||
|
||||
@@ -26,11 +26,11 @@ from __future__ import annotations
|
||||
from math import ceil
|
||||
|
||||
from PyQt5.QtCore import QRect
|
||||
from PyQt5.QtGui import QBrush, QColor, QPaintEvent, QPainter, QPen
|
||||
from PyQt5.QtGui import QBrush, QColor, QPainter, QPaintEvent, QPen
|
||||
from PyQt5.QtWidgets import QProgressBar, QWidget
|
||||
|
||||
from novelwriter.types import (
|
||||
QtPaintAnitAlias, QtAlignCenter, QtRoundCap, QtSizeFixed, QtSolidLine,
|
||||
QtAlignCenter, QtPaintAnitAlias, QtRoundCap, QtSizeFixed, QtSolidLine,
|
||||
QtTransparent
|
||||
)
|
||||
|
||||
@@ -101,5 +101,3 @@ class NProgressCircle(QProgressBar):
|
||||
painter.setPen(self._tColor)
|
||||
painter.drawText(self._cRect, QtAlignCenter, self._text or f"{progress:.1f} %")
|
||||
return
|
||||
|
||||
# END Class NProgressCircle
|
||||
|
||||
@@ -27,8 +27,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from PyQt5.QtGui import QColor, QFont, QPalette
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QColor, QFont, QPalette
|
||||
from PyQt5.QtWidgets import (
|
||||
QAbstractButton, QFrame, QHBoxLayout, QLabel, QLayout, QScrollArea,
|
||||
QVBoxLayout, QWidget
|
||||
@@ -64,8 +64,6 @@ class NFixedPage(QFrame):
|
||||
self.setLayout(layout)
|
||||
return
|
||||
|
||||
# END Class NFixedPage
|
||||
|
||||
|
||||
class NScrollablePage(QScrollArea):
|
||||
"""Extension: Scrollable Page Widget
|
||||
@@ -89,8 +87,6 @@ class NScrollablePage(QScrollArea):
|
||||
self._widget.setLayout(layout)
|
||||
return
|
||||
|
||||
# END Class NScrollablePage
|
||||
|
||||
|
||||
class NScrollableForm(QScrollArea):
|
||||
"""Extension: Scrollable Form Widget
|
||||
@@ -235,8 +231,6 @@ class NScrollableForm(QScrollArea):
|
||||
self._layout.addStretch(1)
|
||||
return
|
||||
|
||||
# END Class NScrollableForm
|
||||
|
||||
|
||||
class NColourLabel(QLabel):
|
||||
"""Extension: A Coloured Label
|
||||
@@ -267,8 +261,6 @@ class NColourLabel(QLabel):
|
||||
|
||||
return
|
||||
|
||||
# END Class NColourLabel
|
||||
|
||||
|
||||
class NWrappedWidgetBox(QHBoxLayout):
|
||||
"""Extension: A Text-Wrapped Widget Box
|
||||
@@ -287,5 +279,3 @@ class NWrappedWidgetBox(QHBoxLayout):
|
||||
if after:
|
||||
self.addWidget(QLabel(after.lstrip()))
|
||||
return
|
||||
|
||||
# END Class NWrappedWidgetBox
|
||||
|
||||
@@ -24,8 +24,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from PyQt5.QtGui import QStatusTipEvent, QWheelEvent
|
||||
from PyQt5.QtCore import QEvent, QObject
|
||||
from PyQt5.QtGui import QStatusTipEvent, QWheelEvent
|
||||
from PyQt5.QtWidgets import QWidget
|
||||
|
||||
|
||||
@@ -63,13 +63,9 @@ class WheelEventFilter(QObject):
|
||||
self._locked = False
|
||||
return False
|
||||
|
||||
# END Class WheelEventFilter
|
||||
|
||||
|
||||
class StatusTipFilter(QObject):
|
||||
|
||||
def eventFilter(self, obj: QObject, event: QEvent) -> bool:
|
||||
"""Filter out status tip events on menus."""
|
||||
return True if isinstance(event, QStatusTipEvent) else super().eventFilter(obj, event)
|
||||
|
||||
# END Class StatusTipFilter
|
||||
|
||||
@@ -61,8 +61,6 @@ class NToolDialog(QDialog):
|
||||
QApplication.processEvents()
|
||||
return
|
||||
|
||||
# END Class NToolDialog
|
||||
|
||||
|
||||
class NNonBlockingDialog(QDialog):
|
||||
|
||||
@@ -80,8 +78,6 @@ class NNonBlockingDialog(QDialog):
|
||||
QApplication.processEvents()
|
||||
return
|
||||
|
||||
# END Class NNonBlockingDialog
|
||||
|
||||
|
||||
class NComboBox(QComboBox):
|
||||
|
||||
@@ -103,8 +99,6 @@ class NComboBox(QComboBox):
|
||||
self.setCurrentIndex(self.findData(default) if idx < 0 else idx)
|
||||
return
|
||||
|
||||
# END Class NComboBox
|
||||
|
||||
|
||||
class NSpinBox(QSpinBox):
|
||||
|
||||
@@ -120,8 +114,6 @@ class NSpinBox(QSpinBox):
|
||||
event.ignore()
|
||||
return
|
||||
|
||||
# END Class NSpinBox
|
||||
|
||||
|
||||
class NDoubleSpinBox(QDoubleSpinBox):
|
||||
|
||||
@@ -137,8 +129,6 @@ class NDoubleSpinBox(QDoubleSpinBox):
|
||||
event.ignore()
|
||||
return
|
||||
|
||||
# END Class NDoubleSpinBox
|
||||
|
||||
|
||||
class NIconToolButton(QToolButton):
|
||||
|
||||
@@ -156,8 +146,6 @@ class NIconToolButton(QToolButton):
|
||||
self.setIcon(SHARED.theme.getIcon(iconKey))
|
||||
return
|
||||
|
||||
# END Class NIconToolButton
|
||||
|
||||
|
||||
class NIconToggleButton(QToolButton):
|
||||
|
||||
@@ -177,5 +165,3 @@ class NIconToggleButton(QToolButton):
|
||||
iconSize = self.iconSize()
|
||||
self.setIcon(SHARED.theme.getToggleIcon(iconKey, (iconSize.width(), iconSize.height())))
|
||||
return
|
||||
|
||||
# END Class NUnfoldButton
|
||||
|
||||
@@ -29,8 +29,8 @@ from PyQt5.QtCore import pyqtSignal, pyqtSlot
|
||||
from PyQt5.QtWidgets import QComboBox, QWidget
|
||||
|
||||
from novelwriter import SHARED
|
||||
from novelwriter.enum import nwItemClass
|
||||
from novelwriter.constants import nwLabels
|
||||
from novelwriter.enum import nwItemClass
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -126,5 +126,3 @@ class NovelSelector(QComboBox):
|
||||
if not self._blockSignal:
|
||||
self.novelSelectionChanged.emit(self.currentData())
|
||||
return
|
||||
|
||||
# END Class NovelSelector
|
||||
|
||||
@@ -25,15 +25,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from PyQt5.QtGui import QColor, QPaintEvent, QPainter, QPolygon
|
||||
from PyQt5.QtCore import QPoint, QRectF, QSize, Qt, pyqtSignal, pyqtSlot
|
||||
from PyQt5.QtGui import QColor, QPainter, QPaintEvent, QPolygon
|
||||
from PyQt5.QtWidgets import (
|
||||
QAbstractButton, QAction, QButtonGroup, QLabel, QStyle,
|
||||
QStyleOptionToolButton, QToolBar, QToolButton, QWidget
|
||||
)
|
||||
|
||||
from novelwriter.types import (
|
||||
QtPaintAnitAlias, QtAlignLeft, QtMouseOver, QtNoBrush, QtNoPen,
|
||||
QtAlignLeft, QtMouseOver, QtNoBrush, QtNoPen, QtPaintAnitAlias,
|
||||
QtSizeExpanding, QtSizeFixed
|
||||
)
|
||||
|
||||
@@ -112,8 +112,6 @@ class NPagedSideBar(QToolBar):
|
||||
self.buttonClicked.emit(buttonId)
|
||||
return
|
||||
|
||||
# END Class NPagedSideBar
|
||||
|
||||
|
||||
class _NPagedToolButton(QToolButton):
|
||||
|
||||
@@ -190,8 +188,6 @@ class _NPagedToolButton(QToolButton):
|
||||
|
||||
return
|
||||
|
||||
# END Class _NPagedToolButton
|
||||
|
||||
|
||||
class _NPagedToolLabel(QLabel):
|
||||
|
||||
@@ -231,5 +227,3 @@ class _NPagedToolLabel(QLabel):
|
||||
paint.drawText(QRectF(self._lM, self._tM, tW, tH), QtAlignLeft, self.text())
|
||||
|
||||
return
|
||||
|
||||
# END Class _NPagedToolLabel
|
||||
|
||||
@@ -25,7 +25,7 @@ from __future__ import annotations
|
||||
|
||||
from math import ceil
|
||||
|
||||
from PyQt5.QtGui import QPaintEvent, QPainter
|
||||
from PyQt5.QtGui import QPainter, QPaintEvent
|
||||
from PyQt5.QtWidgets import QProgressBar, QWidget
|
||||
|
||||
from novelwriter.types import QtPaintAnitAlias
|
||||
@@ -51,5 +51,3 @@ class NProgressSimple(QProgressBar):
|
||||
painter.setBrush(self.palette().highlight())
|
||||
painter.drawRect(0, 0, progress, self.height())
|
||||
return
|
||||
|
||||
# END Class NProgressSimple
|
||||
|
||||
@@ -27,7 +27,7 @@ import logging
|
||||
|
||||
from typing import Literal
|
||||
|
||||
from PyQt5.QtGui import QColor, QPaintEvent, QPainter
|
||||
from PyQt5.QtGui import QColor, QPainter, QPaintEvent
|
||||
from PyQt5.QtWidgets import QAbstractButton, QWidget
|
||||
|
||||
from novelwriter.types import QtPaintAnitAlias
|
||||
@@ -75,5 +75,3 @@ class StatusLED(QAbstractButton):
|
||||
painter.setOpacity(1.0)
|
||||
painter.drawEllipse(1, 1, self.width() - 2, self.height() - 2)
|
||||
return
|
||||
|
||||
# END Class StatusLED
|
||||
|
||||
@@ -23,12 +23,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from PyQt5.QtGui import QMouseEvent, QPainter, QPaintEvent, QResizeEvent
|
||||
from PyQt5.QtCore import QEvent, QPropertyAnimation, Qt, pyqtProperty
|
||||
from PyQt5.QtGui import QMouseEvent, QPainter, QPaintEvent, QResizeEvent
|
||||
from PyQt5.QtWidgets import QAbstractButton, QWidget
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.types import QtPaintAnitAlias, QtMouseLeft, QtNoPen, QtSizeFixed
|
||||
from novelwriter.types import QtMouseLeft, QtNoPen, QtPaintAnitAlias, QtSizeFixed
|
||||
|
||||
|
||||
class NSwitch(QAbstractButton):
|
||||
@@ -133,5 +133,3 @@ class NSwitch(QAbstractButton):
|
||||
self.setCursor(Qt.CursorShape.PointingHandCursor)
|
||||
super().enterEvent(event)
|
||||
return
|
||||
|
||||
# END Class NSwitch
|
||||
|
||||
@@ -23,8 +23,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtWidgets import QGridLayout, QLabel, QScrollArea, QWidget
|
||||
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
@@ -127,5 +127,3 @@ class NSwitchBox(QScrollArea):
|
||||
self._content.setRowStretch(self._index + 1, 1)
|
||||
self._index += 1
|
||||
return
|
||||
|
||||
# END Class NSwitchBox
|
||||
|
||||
@@ -26,16 +26,16 @@ from __future__ import annotations
|
||||
import json
|
||||
import logging
|
||||
|
||||
from time import sleep
|
||||
from datetime import datetime
|
||||
from time import sleep
|
||||
from urllib.error import HTTPError
|
||||
from urllib.request import Request, urlopen
|
||||
|
||||
from PyQt5.QtGui import QDesktopServices
|
||||
from PyQt5.QtCore import QObject, QRunnable, QUrl, pyqtSignal, pyqtSlot
|
||||
from PyQt5.QtGui import QDesktopServices
|
||||
from PyQt5.QtWidgets import QLabel, QVBoxLayout, QWidget
|
||||
|
||||
from novelwriter import CONFIG, SHARED, __version__, __date__, __domain__
|
||||
from novelwriter import CONFIG, SHARED, __date__, __domain__, __version__
|
||||
from novelwriter.common import formatVersion
|
||||
from novelwriter.constants import nwConst
|
||||
|
||||
@@ -111,8 +111,6 @@ class VersionInfoWidget(QWidget):
|
||||
self._lblRelease.setText(self._trLatest.format(reason or self.tr("Failed")))
|
||||
return
|
||||
|
||||
# END Class VersionInfoWidget
|
||||
|
||||
|
||||
class _Retriever(QRunnable):
|
||||
|
||||
@@ -144,10 +142,6 @@ class _Retriever(QRunnable):
|
||||
self.signals.dataReady.emit("", str(e))
|
||||
return
|
||||
|
||||
# END Class _Retriever
|
||||
|
||||
|
||||
class _RetrieverSignal(QObject):
|
||||
dataReady = pyqtSignal(str, str)
|
||||
|
||||
# END Class _RetrieverSignal
|
||||
|
||||
@@ -78,9 +78,7 @@ class _SelectAction(Enum):
|
||||
KEEP_POSITION = 2
|
||||
MOVE_AFTER = 3
|
||||
|
||||
# END Class _SelectAction
|
||||
|
||||
|
||||
|
||||
class GuiDocEditor(QPlainTextEdit):
|
||||
"""Gui Widget: Main Document Editor"""
|
||||
|
||||
@@ -2131,7 +2129,7 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
self._doReplace = False
|
||||
return
|
||||
|
||||
# END Class GuiDocEditor
|
||||
|
||||
|
||||
|
||||
class MetaCompleter(QMenu):
|
||||
@@ -2210,7 +2208,7 @@ class MetaCompleter(QMenu):
|
||||
self.complete.emit(pos, length, value)
|
||||
return
|
||||
|
||||
# END Class MetaCompleter
|
||||
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
@@ -2251,7 +2249,7 @@ class BackgroundWordCounter(QRunnable):
|
||||
|
||||
return
|
||||
|
||||
# END Class BackgroundWordCounter
|
||||
|
||||
|
||||
|
||||
class BackgroundWordCounterSignals(QObject):
|
||||
@@ -2260,7 +2258,7 @@ class BackgroundWordCounterSignals(QObject):
|
||||
"""
|
||||
countsReady = pyqtSignal(int, int, int)
|
||||
|
||||
# END Class BackgroundWordCounterSignals
|
||||
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
@@ -2393,7 +2391,7 @@ class GuiDocToolBar(QWidget):
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiDocToolBar
|
||||
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
@@ -2757,7 +2755,7 @@ class GuiDocEditSearch(QFrame):
|
||||
self.searchBox.setPalette(qPalette)
|
||||
return
|
||||
|
||||
# END Class GuiDocEditSearch
|
||||
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
@@ -2980,7 +2978,7 @@ class GuiDocEditHeader(QWidget):
|
||||
self.docEditor.requestProjectItemSelected.emit(self._docHandle or "", True)
|
||||
return
|
||||
|
||||
# END Class GuiDocEditHeader
|
||||
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
@@ -3172,4 +3170,4 @@ class GuiDocEditFooter(QWidget):
|
||||
self.wordsText.setText(wText)
|
||||
return
|
||||
|
||||
# END Class GuiDocEditFooter
|
||||
|
||||
|
||||
@@ -463,8 +463,6 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiDocHighlighter
|
||||
|
||||
|
||||
class TextBlockData(QTextBlockUserData):
|
||||
|
||||
@@ -505,5 +503,3 @@ class TextBlockData(QTextBlockUserData):
|
||||
(rxMatch.capturedStart(0), rxMatch.capturedLength(0))
|
||||
)
|
||||
return self._spellErrors
|
||||
|
||||
# END Class TextBlockData
|
||||
|
||||
@@ -496,8 +496,6 @@ class GuiDocViewer(QTextBrowser):
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiDocViewer
|
||||
|
||||
|
||||
class GuiDocViewHistory:
|
||||
|
||||
@@ -611,8 +609,6 @@ class GuiDocViewHistory:
|
||||
)
|
||||
return
|
||||
|
||||
# END Class GuiDocViewHistory
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
# The Embedded Document Header
|
||||
@@ -835,8 +831,6 @@ class GuiDocViewHeader(QWidget):
|
||||
self.docViewer.requestProjectItemSelected.emit(self._docHandle, True)
|
||||
return
|
||||
|
||||
# END Class GuiDocViewHeader
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
# The Embedded Document Footer
|
||||
@@ -967,5 +961,3 @@ class GuiDocViewFooter(QWidget):
|
||||
CONFIG.viewSynopsis = state
|
||||
self.docViewer.reloadText()
|
||||
return
|
||||
|
||||
# END Class GuiDocViewFooter
|
||||
|
||||
@@ -221,8 +221,6 @@ class GuiDocViewerPanel(QWidget):
|
||||
self.kwTabs[tClass].addUpdateEntry(key, name, iItem, hItem)
|
||||
return
|
||||
|
||||
# END Class GuiDocViewerPanel
|
||||
|
||||
|
||||
class _ViewPanelBackRefs(QTreeWidget):
|
||||
|
||||
@@ -360,8 +358,6 @@ class _ViewPanelBackRefs(QTreeWidget):
|
||||
|
||||
return
|
||||
|
||||
# END Class _ViewPanelBackRefs
|
||||
|
||||
|
||||
class _ViewPanelKeyWords(QTreeWidget):
|
||||
|
||||
@@ -528,5 +524,3 @@ class _ViewPanelKeyWords(QTreeWidget):
|
||||
if index.column() not in (self.C_EDIT, self.C_VIEW):
|
||||
self._parent.loadDocumentTagRequest.emit(tag, nwDocMode.VIEW)
|
||||
return
|
||||
|
||||
# END Class _ViewPanelKeyWords
|
||||
|
||||
@@ -28,8 +28,8 @@ import logging
|
||||
from collections.abc import Iterable
|
||||
from time import time
|
||||
|
||||
from PyQt5.QtGui import QTextBlock, QTextCursor, QTextDocument
|
||||
from PyQt5.QtCore import QObject, pyqtSlot
|
||||
from PyQt5.QtGui import QTextBlock, QTextCursor, QTextDocument
|
||||
from PyQt5.QtWidgets import QApplication, QPlainTextDocumentLayout
|
||||
|
||||
from novelwriter import SHARED
|
||||
@@ -133,5 +133,3 @@ class GuiTextDocument(QTextDocument):
|
||||
"""Set the spell check state of the syntax highlighter."""
|
||||
self._syntax.setSpellCheck(state)
|
||||
return
|
||||
|
||||
# END Class GuiTextDocument
|
||||
|
||||
@@ -295,5 +295,3 @@ class GuiItemDetails(QWidget):
|
||||
self.wCountData.setText(f"{wC:n}")
|
||||
self.pCountData.setText(f"{pC:n}")
|
||||
return
|
||||
|
||||
# END Class GuiItemDetails
|
||||
|
||||
@@ -991,5 +991,3 @@ class GuiMainMenu(QMenuBar):
|
||||
self.aWebsite.triggered.connect(lambda: self._openWebsite(nwConst.URL_WEB))
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiMainMenu
|
||||
|
||||
@@ -185,8 +185,6 @@ class GuiNovelView(QWidget):
|
||||
self.novelTree.refreshHandle(tHandle)
|
||||
return
|
||||
|
||||
# END Class GuiNovelView
|
||||
|
||||
|
||||
class GuiNovelToolBar(QWidget):
|
||||
|
||||
@@ -349,8 +347,6 @@ class GuiNovelToolBar(QWidget):
|
||||
self.aLastCol[colType] = aLast
|
||||
return
|
||||
|
||||
# END Class GuiNovelToolBar
|
||||
|
||||
|
||||
class GuiNovelTree(QTreeWidget):
|
||||
|
||||
@@ -778,5 +774,3 @@ class GuiNovelTree(QTreeWidget):
|
||||
if tags:
|
||||
lines.append(f"<b>{trConst(nwLabels.KEY_NAME[key])}</b>: {tags}")
|
||||
return lines
|
||||
|
||||
# END Class GuiNovelTree
|
||||
|
||||
@@ -30,10 +30,10 @@ from __future__ import annotations
|
||||
import csv
|
||||
import logging
|
||||
|
||||
from time import time
|
||||
from enum import Enum
|
||||
from time import time
|
||||
|
||||
from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot, QT_TRANSLATE_NOOP
|
||||
from PyQt5.QtCore import QT_TRANSLATE_NOOP, Qt, pyqtSignal, pyqtSlot
|
||||
from PyQt5.QtWidgets import (
|
||||
QAbstractItemView, QAction, QFileDialog, QFrame, QGridLayout, QGroupBox,
|
||||
QHBoxLayout, QLabel, QMenu, QScrollArea, QSplitter, QToolBar, QToolButton,
|
||||
@@ -41,10 +41,10 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import checkInt, formatFileFilter, makeFileNameSafe
|
||||
from novelwriter.constants import nwHeaders, nwKeyWords, nwLabels, trConst
|
||||
from novelwriter.enum import nwDocMode, nwItemClass, nwItemLayout, nwItemType, nwOutline
|
||||
from novelwriter.error import logException
|
||||
from novelwriter.common import checkInt, formatFileFilter, makeFileNameSafe
|
||||
from novelwriter.constants import nwHeaders, trConst, nwKeyWords, nwLabels
|
||||
from novelwriter.extensions.configlayout import NColourLabel
|
||||
from novelwriter.extensions.novelselector import NovelSelector
|
||||
from novelwriter.types import (
|
||||
@@ -52,7 +52,6 @@ from novelwriter.types import (
|
||||
QtSizeExpanding, QtUserRole
|
||||
)
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -195,8 +194,6 @@ class GuiOutlineView(QWidget):
|
||||
self.outlineTree.refreshTree(rootHandle=(tHandle or None), overRide=True)
|
||||
return
|
||||
|
||||
# END Class GuiOutlineView
|
||||
|
||||
|
||||
class GuiOutlineToolBar(QToolBar):
|
||||
|
||||
@@ -310,8 +307,6 @@ class GuiOutlineToolBar(QToolBar):
|
||||
self.outlineExportRequest.emit()
|
||||
return
|
||||
|
||||
# END Class GuiOutlineToolBar
|
||||
|
||||
|
||||
class GuiOutlineTree(QTreeWidget):
|
||||
|
||||
@@ -727,8 +722,6 @@ class GuiOutlineTree(QTreeWidget):
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiOutlineTree
|
||||
|
||||
|
||||
class GuiOutlineHeaderMenu(QMenu):
|
||||
|
||||
@@ -771,8 +764,6 @@ class GuiOutlineHeaderMenu(QMenu):
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiOutlineHeaderMenu
|
||||
|
||||
|
||||
class GuiOutlineDetails(QScrollArea):
|
||||
|
||||
@@ -1103,5 +1094,3 @@ class GuiOutlineDetails(QScrollArea):
|
||||
return ", ".join(
|
||||
[f"<a href='{tag}'>{tag}</a>" for tag in refs.get(key, [])]
|
||||
)
|
||||
|
||||
# END Class GuiOutlineDetails
|
||||
|
||||
@@ -243,8 +243,6 @@ class GuiProjectView(QWidget):
|
||||
self.projTree.createNewNote(tag, itemClass)
|
||||
return
|
||||
|
||||
# END Class GuiProjectView
|
||||
|
||||
|
||||
class GuiProjectToolBar(QWidget):
|
||||
|
||||
@@ -470,8 +468,6 @@ class GuiProjectToolBar(QWidget):
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiProjectToolBar
|
||||
|
||||
|
||||
class GuiProjectTree(QTreeWidget):
|
||||
|
||||
@@ -1651,8 +1647,6 @@ class GuiProjectTree(QTreeWidget):
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiProjectTree
|
||||
|
||||
|
||||
class _UpdatableMenu(QMenu):
|
||||
|
||||
@@ -1716,8 +1710,6 @@ class _UpdatableMenu(QMenu):
|
||||
self.menuItemTriggered.emit(str(action.data()))
|
||||
return
|
||||
|
||||
# END Class _UpdatableMenu
|
||||
|
||||
|
||||
class _TreeContextMenu(QMenu):
|
||||
|
||||
@@ -2069,5 +2061,3 @@ class _TreeContextMenu(QMenu):
|
||||
else:
|
||||
logger.info("Folder conversion cancelled")
|
||||
return
|
||||
|
||||
# END Class _TreeContextMenu
|
||||
|
||||
@@ -358,5 +358,3 @@ class GuiProjectSearch(QWidget):
|
||||
QApplication.processEvents()
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiProjectSearch
|
||||
|
||||
@@ -150,8 +150,6 @@ class GuiSideBar(QWidget):
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiSideBar
|
||||
|
||||
|
||||
class _PopRightMenu(QMenu):
|
||||
|
||||
@@ -162,5 +160,3 @@ class _PopRightMenu(QMenu):
|
||||
offset = QPoint(parent.width(), parent.height() - self.height())
|
||||
self.move(parent.mapToGlobal(offset))
|
||||
return super(_PopRightMenu, self).event(event)
|
||||
|
||||
# END Class _PopRightMenu
|
||||
|
||||
@@ -262,5 +262,3 @@ class GuiMainStatus(QStatusBar):
|
||||
f" \u2013 Peak: {mem[1]:n}"
|
||||
), 6000)
|
||||
return
|
||||
|
||||
# END Class GuiMainStatus
|
||||
|
||||
@@ -795,8 +795,6 @@ class GuiIcons:
|
||||
|
||||
return self._noIcon
|
||||
|
||||
# END Class GuiIcons
|
||||
|
||||
|
||||
# =============================================================================================== #
|
||||
# Module Functions
|
||||
|
||||
@@ -1399,5 +1399,3 @@ class GuiMain(QMainWindow):
|
||||
))
|
||||
return None, None
|
||||
return tHandle, sTitle
|
||||
|
||||
# END Class GuiMain
|
||||
|
||||
@@ -376,8 +376,6 @@ class SharedData(QObject):
|
||||
widget.close()
|
||||
return
|
||||
|
||||
# END Class SharedData
|
||||
|
||||
|
||||
class _GuiAlert(QMessageBox):
|
||||
|
||||
@@ -438,5 +436,3 @@ class _GuiAlert(QMessageBox):
|
||||
self.setIconPixmap(self._theme.getPixmap("alert_question", (pSz, pSz)))
|
||||
self.setWindowTitle(self.tr("Question"))
|
||||
return
|
||||
|
||||
# END Class _GuiAlert
|
||||
|
||||
@@ -264,5 +264,3 @@ class GuiDictionaries(NNonBlockingDialog):
|
||||
cursor.deleteChar()
|
||||
self.infoBox.setTextCursor(cursor)
|
||||
return
|
||||
|
||||
# END Class GuiDictionaries
|
||||
|
||||
@@ -23,8 +23,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import random
|
||||
import logging
|
||||
import random
|
||||
|
||||
from PyQt5.QtCore import Qt, pyqtSlot
|
||||
from PyQt5.QtWidgets import (
|
||||
@@ -35,7 +35,7 @@ from PyQt5.QtWidgets import (
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import readTextFile
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
from novelwriter.types import QtAlignLeft, QtAlignRight, QtRoleAction, QtDialogClose
|
||||
from novelwriter.types import QtAlignLeft, QtAlignRight, QtDialogClose, QtRoleAction
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -150,5 +150,3 @@ class GuiLipsum(QDialog):
|
||||
self._lipsumText = "\n\n".join(lipsumText[0:pCount]) + "\n\n"
|
||||
self.close()
|
||||
return
|
||||
|
||||
# END Class GuiLipsum
|
||||
|
||||
@@ -403,5 +403,3 @@ class GuiManuscriptBuild(QDialog):
|
||||
"""Open the build folder in the system's file explorer."""
|
||||
openExternalPath(Path(self.buildPath.text()))
|
||||
return
|
||||
|
||||
# END Class GuiManuscriptBuild
|
||||
|
||||
@@ -510,8 +510,6 @@ class GuiManuscript(NToolDialog):
|
||||
return obj
|
||||
return None
|
||||
|
||||
# END Class GuiManuscript
|
||||
|
||||
|
||||
class _DetailsWidget(QWidget):
|
||||
|
||||
@@ -653,8 +651,6 @@ class _DetailsWidget(QWidget):
|
||||
|
||||
return
|
||||
|
||||
# END Class _DetailsWidget
|
||||
|
||||
|
||||
class _OutlineWidget(QWidget):
|
||||
|
||||
@@ -734,8 +730,6 @@ class _OutlineWidget(QWidget):
|
||||
self.outlineEntryClicked.emit(str(item.data(0, self.D_LINE)))
|
||||
return
|
||||
|
||||
# END Class _OutlineWidget
|
||||
|
||||
|
||||
class _PreviewWidget(QTextBrowser):
|
||||
|
||||
@@ -961,8 +955,6 @@ class _PreviewWidget(QTextBrowser):
|
||||
self.buildProgress.move((vW-pS)//2, (vH-pS)//2)
|
||||
return
|
||||
|
||||
# END Class _PreviewWidget
|
||||
|
||||
|
||||
class _StatsWidget(QWidget):
|
||||
|
||||
@@ -1136,5 +1128,3 @@ class _StatsWidget(QWidget):
|
||||
self.maxWidget.setLayout(self.maxLayout)
|
||||
|
||||
return
|
||||
|
||||
# END Class _StatsWidget
|
||||
|
||||
@@ -278,8 +278,6 @@ class GuiBuildSettings(NToolDialog):
|
||||
self._build.resetChangedState()
|
||||
return
|
||||
|
||||
# END Class GuiBuildSettings
|
||||
|
||||
|
||||
class _FilterTab(NFixedPage):
|
||||
|
||||
@@ -574,8 +572,6 @@ class _FilterTab(NFixedPage):
|
||||
self._scanChildren(item.child(i), items)
|
||||
return items
|
||||
|
||||
# END Class _FilterTab
|
||||
|
||||
|
||||
class _HeadingsTab(NScrollablePage):
|
||||
|
||||
@@ -941,8 +937,6 @@ class _HeadingsTab(NScrollablePage):
|
||||
|
||||
return
|
||||
|
||||
# END Class _HeadingsTab
|
||||
|
||||
|
||||
class _HeadingSyntaxHighlighter(QSyntaxHighlighter):
|
||||
|
||||
@@ -967,8 +961,6 @@ class _HeadingSyntaxHighlighter(QSyntaxHighlighter):
|
||||
self.setFormat(pos + ddots, 1, self._fmtSymbol)
|
||||
return
|
||||
|
||||
# END Class _HeadingSyntaxHighlighter
|
||||
|
||||
|
||||
class _ContentTab(NScrollableForm):
|
||||
|
||||
@@ -1052,8 +1044,6 @@ class _ContentTab(NScrollableForm):
|
||||
self.ignoredKeywords.setText(", ".join(verified))
|
||||
return
|
||||
|
||||
# END Class _ContentTab
|
||||
|
||||
|
||||
class _FormatTab(NScrollableForm):
|
||||
|
||||
@@ -1346,8 +1336,6 @@ class _FormatTab(NScrollableForm):
|
||||
self.pageSize.setCurrentIndex(index)
|
||||
return
|
||||
|
||||
# END Class _FormatTab
|
||||
|
||||
|
||||
class _OutputTab(NScrollableForm):
|
||||
|
||||
@@ -1432,5 +1420,3 @@ class _OutputTab(NScrollableForm):
|
||||
self.odtPageHeader.setText(nwHeadFmt.ODT_AUTO)
|
||||
self.odtPageHeader.setCursorPosition(0)
|
||||
return
|
||||
|
||||
# END Class _OutputTab
|
||||
|
||||
@@ -186,8 +186,6 @@ class GuiNovelDetails(NNonBlockingDialog):
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiNovelDetails
|
||||
|
||||
|
||||
class _OverviewPage(NScrollablePage):
|
||||
|
||||
@@ -294,8 +292,6 @@ class _OverviewPage(NScrollablePage):
|
||||
|
||||
return
|
||||
|
||||
# END Class _OverviewPage
|
||||
|
||||
|
||||
class _ContentsPage(NFixedPage):
|
||||
|
||||
@@ -524,5 +520,3 @@ class _ContentsPage(NFixedPage):
|
||||
self._data = SHARED.project.index.getTableOfContents(rootHandle, 2)
|
||||
self._data.append(("", 0, self.tr("END"), 0))
|
||||
return
|
||||
|
||||
# END Class _ContentsPage
|
||||
|
||||
@@ -32,11 +32,11 @@ from PyQt5.QtCore import (
|
||||
QAbstractListModel, QEvent, QModelIndex, QObject, QPoint, QSize, Qt,
|
||||
pyqtSignal, pyqtSlot
|
||||
)
|
||||
from PyQt5.QtGui import QCloseEvent, QColor, QFont, QPaintEvent, QPainter, QPen
|
||||
from PyQt5.QtGui import QCloseEvent, QColor, QFont, QPainter, QPaintEvent, QPen
|
||||
from PyQt5.QtWidgets import (
|
||||
QAction, QApplication, QDialog, QFileDialog, QFormLayout, QHBoxLayout,
|
||||
QLabel, QLineEdit, QListView, QMenu, QPushButton, QScrollArea, QShortcut,
|
||||
QStackedWidget, QStyleOptionViewItem, QStyledItemDelegate, QVBoxLayout,
|
||||
QStackedWidget, QStyledItemDelegate, QStyleOptionViewItem, QVBoxLayout,
|
||||
QWidget
|
||||
)
|
||||
|
||||
@@ -267,8 +267,6 @@ class GuiWelcome(QDialog):
|
||||
self.btnCreate.setFocus()
|
||||
return
|
||||
|
||||
# END Class GuiWelcome
|
||||
|
||||
|
||||
class _OpenProjectPage(QWidget):
|
||||
|
||||
@@ -392,8 +390,6 @@ class _OpenProjectPage(QWidget):
|
||||
self._projectClicked(index)
|
||||
return
|
||||
|
||||
# END Class _OpenProjectPage
|
||||
|
||||
|
||||
class _ProjectListItem(QStyledItemDelegate):
|
||||
|
||||
@@ -450,8 +446,6 @@ class _ProjectListItem(QStyledItemDelegate):
|
||||
"""Set the size hint to fixed height."""
|
||||
return QSize(opt.rect.width(), self._hPx)
|
||||
|
||||
# END Class _ProjectListItem
|
||||
|
||||
|
||||
class _ProjectListModel(QAbstractListModel):
|
||||
|
||||
@@ -491,8 +485,6 @@ class _ProjectListModel(QAbstractListModel):
|
||||
return True
|
||||
return False
|
||||
|
||||
# END Class _ProjectListModel
|
||||
|
||||
|
||||
class _NewProjectPage(QWidget):
|
||||
|
||||
@@ -548,8 +540,6 @@ class _NewProjectPage(QWidget):
|
||||
self.openProjectRequest.emit(path)
|
||||
return
|
||||
|
||||
# END Class _NewProjectPage
|
||||
|
||||
|
||||
class _NewProjectForm(QWidget):
|
||||
|
||||
@@ -805,8 +795,6 @@ class _NewProjectForm(QWidget):
|
||||
|
||||
return
|
||||
|
||||
# END Class _NewProjectForm
|
||||
|
||||
|
||||
class _PopLeftDirectionMenu(QMenu):
|
||||
|
||||
@@ -817,5 +805,3 @@ class _PopLeftDirectionMenu(QMenu):
|
||||
offset = QPoint(parent.width() - self.width(), parent.height())
|
||||
self.move(parent.mapToGlobal(offset))
|
||||
return super(_PopLeftDirectionMenu, self).event(event)
|
||||
|
||||
# END Class _PopLeftDirectionMenu
|
||||
|
||||
@@ -614,5 +614,3 @@ class GuiWritingStats(NToolDialog):
|
||||
self.labelFilter.setText(formatTime(round(self.timeFilter)))
|
||||
|
||||
return
|
||||
|
||||
# END Class GuiWritingStats
|
||||
|
||||
@@ -1718,5 +1718,3 @@ if __name__ == "__main__":
|
||||
sys.exit(1)
|
||||
else:
|
||||
xdgUninstall()
|
||||
|
||||
# END Main
|
||||
|
||||
+1
-9
@@ -23,11 +23,11 @@ from __future__ import annotations
|
||||
from PyQt5.QtGui import QPixmap
|
||||
from PyQt5.QtWidgets import QWidget
|
||||
|
||||
|
||||
# =========================================================================== #
|
||||
# Mock GUI
|
||||
# =========================================================================== #
|
||||
|
||||
|
||||
class MockGuiMain(QWidget):
|
||||
|
||||
def __init__(self):
|
||||
@@ -55,8 +55,6 @@ class MockGuiMain(QWidget):
|
||||
def close(self):
|
||||
return "close"
|
||||
|
||||
# END Class MockGuiMain
|
||||
|
||||
|
||||
class MockStatusBar:
|
||||
|
||||
@@ -69,8 +67,6 @@ class MockStatusBar:
|
||||
def updateProjectStatus(self, status):
|
||||
return
|
||||
|
||||
# END Class MockStatusBar
|
||||
|
||||
|
||||
class MockTheme:
|
||||
|
||||
@@ -81,8 +77,6 @@ class MockTheme:
|
||||
def getPixmap(self, *a):
|
||||
return QPixmap()
|
||||
|
||||
# END Class MockTheme
|
||||
|
||||
|
||||
class MockApp:
|
||||
|
||||
@@ -92,8 +86,6 @@ class MockApp:
|
||||
def installTranslator(self, language):
|
||||
return
|
||||
|
||||
# END Class MockApp
|
||||
|
||||
|
||||
# =========================================================================== #
|
||||
# Error Functions
|
||||
|
||||
@@ -22,10 +22,9 @@ from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from tools import SimpleDialog
|
||||
|
||||
from PyQt5.QtGui import QWheelEvent
|
||||
from PyQt5.QtCore import QPoint, QPointF, Qt
|
||||
from PyQt5.QtGui import QWheelEvent
|
||||
from tools import SimpleDialog
|
||||
|
||||
from novelwriter.extensions.modified import NComboBox, NDoubleSpinBox, NSpinBox
|
||||
|
||||
@@ -46,8 +45,6 @@ class MockWheelEvent(QWheelEvent):
|
||||
self.ignored = True
|
||||
return
|
||||
|
||||
# END Class MockWheelEvent
|
||||
|
||||
|
||||
@pytest.mark.gui
|
||||
def testExtModified_NComboBox(qtbot, monkeypatch):
|
||||
|
||||
+2
-6
@@ -22,8 +22,8 @@ from __future__ import annotations
|
||||
|
||||
import shutil
|
||||
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from PyQt5.QtWidgets import QDialog, QVBoxLayout, QWidget
|
||||
|
||||
@@ -57,8 +57,6 @@ class C:
|
||||
hChapterDoc = "000000000000e"
|
||||
hSceneDoc = "000000000000f"
|
||||
|
||||
# END Class C
|
||||
|
||||
|
||||
def cmpFiles(
|
||||
fileOne: str | Path, fileTwo: str | Path,
|
||||
@@ -148,9 +146,9 @@ def buildTestProject(obj: object, projPath: Path) -> None:
|
||||
"""Build a standard test project in projPath using the project
|
||||
object as the parent.
|
||||
"""
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.enum import nwItemClass
|
||||
from novelwriter.guimain import GuiMain
|
||||
from novelwriter.core.project import NWProject
|
||||
|
||||
if isinstance(obj, NWProject):
|
||||
nwGUI = None
|
||||
@@ -220,5 +218,3 @@ class SimpleDialog(QDialog):
|
||||
@property
|
||||
def widget(self) -> QWidget:
|
||||
return self._widget
|
||||
|
||||
# END Class TestDialog
|
||||
|
||||
Reference in New Issue
Block a user