Remove banner comments
This commit is contained in:
@@ -708,9 +708,8 @@ class NWIndex:
|
|||||||
return "", "", None, None
|
return "", "", None, None
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
# The Tags Index Object
|
||||||
# The Tags Index Object
|
# =====================
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class TagsIndex:
|
class TagsIndex:
|
||||||
"""Core: Tags Index Wrapper Class
|
"""Core: Tags Index Wrapper Class
|
||||||
@@ -831,9 +830,8 @@ class TagsIndex:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
# The Item Index Objects
|
||||||
# The Item Index Objects
|
# ======================
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class ItemIndex:
|
class ItemIndex:
|
||||||
"""Core: Item Index Wrapper Class
|
"""Core: Item Index Wrapper Class
|
||||||
@@ -1346,9 +1344,9 @@ class IndexHeading:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
# Text Processing Functions
|
||||||
# Text Processing Functions
|
# =========================
|
||||||
# =============================================================================================== #
|
|
||||||
MODIFIERS = {
|
MODIFIERS = {
|
||||||
"synopsis": nwComment.SYNOPSIS,
|
"synopsis": nwComment.SYNOPSIS,
|
||||||
"short": nwComment.SHORT,
|
"short": nwComment.SHORT,
|
||||||
|
|||||||
@@ -1080,9 +1080,8 @@ class ToOdt(Tokenizer):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
# Auto-Style Classes
|
||||||
# Auto-Style Classes
|
# ==================
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class ODTParagraphStyle:
|
class ODTParagraphStyle:
|
||||||
"""Wrapper class for the paragraph style setting used by the
|
"""Wrapper class for the paragraph style setting used by the
|
||||||
@@ -1454,9 +1453,9 @@ class ODTTextStyle:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
# XML Complex Element Helper Class
|
||||||
# XML Complex Element Helper Class
|
# ================================
|
||||||
# =============================================================================================== #
|
|
||||||
X_ROOT_TEXT = 0
|
X_ROOT_TEXT = 0
|
||||||
X_ROOT_TAIL = 1
|
X_ROOT_TAIL = 1
|
||||||
X_SPAN_TEXT = 2
|
X_SPAN_TEXT = 2
|
||||||
|
|||||||
@@ -42,10 +42,6 @@ if TYPE_CHECKING: # pragma: no cover
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# Utility Functions
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
def logException() -> None:
|
def logException() -> None:
|
||||||
"""Log the content of an exception message."""
|
"""Log the content of an exception message."""
|
||||||
exType, exValue, _ = sys.exc_info()
|
exType, exValue, _ = sys.exc_info()
|
||||||
@@ -61,10 +57,6 @@ def formatException(exc: BaseException) -> str:
|
|||||||
return f"{type(exc).__name__}: {str(exc)}"
|
return f"{type(exc).__name__}: {str(exc)}"
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# Error Handler
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class NWErrorMessage(QDialog):
|
class NWErrorMessage(QDialog):
|
||||||
|
|
||||||
def __init__(self, parent: QWidget) -> None:
|
def __init__(self, parent: QWidget) -> None:
|
||||||
|
|||||||
@@ -2130,8 +2130,6 @@ class GuiDocEditor(QPlainTextEdit):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MetaCompleter(QMenu):
|
class MetaCompleter(QMenu):
|
||||||
"""GuiWidget: Meta Completer Menu
|
"""GuiWidget: Meta Completer Menu
|
||||||
|
|
||||||
@@ -2209,14 +2207,12 @@ class MetaCompleter(QMenu):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# The Off-GUI Thread Word Counter
|
|
||||||
# A runnable for the word counter to be run in the thread pool off the main GUI thread.
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class BackgroundWordCounter(QRunnable):
|
class BackgroundWordCounter(QRunnable):
|
||||||
|
"""The Off-GUI Thread Word Counter
|
||||||
|
|
||||||
|
A runnable for the word counter to be run in the thread pool off the
|
||||||
|
main GUI thread.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, docEditor: GuiDocEditor, forSelection: bool = False) -> None:
|
def __init__(self, docEditor: GuiDocEditor, forSelection: bool = False) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -2250,8 +2246,6 @@ class BackgroundWordCounter(QRunnable):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class BackgroundWordCounterSignals(QObject):
|
class BackgroundWordCounterSignals(QObject):
|
||||||
"""The QRunnable cannot emit a signal, so we need a simple QObject
|
"""The QRunnable cannot emit a signal, so we need a simple QObject
|
||||||
to hold the word counter signal.
|
to hold the word counter signal.
|
||||||
@@ -2259,14 +2253,12 @@ class BackgroundWordCounterSignals(QObject):
|
|||||||
countsReady = pyqtSignal(int, int, int)
|
countsReady = pyqtSignal(int, int, int)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# The Formatting and Options Fold Out Menu
|
|
||||||
# Only used by DocEditor, and is opened by the first button in the header
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class GuiDocToolBar(QWidget):
|
class GuiDocToolBar(QWidget):
|
||||||
|
"""The Formatting and Options Fold Out Menu
|
||||||
|
|
||||||
|
Only used by DocEditor, and is opened by the first button in the
|
||||||
|
header.
|
||||||
|
"""
|
||||||
|
|
||||||
requestDocAction = pyqtSignal(nwDocAction)
|
requestDocAction = pyqtSignal(nwDocAction)
|
||||||
|
|
||||||
@@ -2392,14 +2384,12 @@ class GuiDocToolBar(QWidget):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# The Embedded Document Search/Replace Feature
|
|
||||||
# Only used by DocEditor, and is at a fixed position in the QTextEdit's viewport
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class GuiDocEditSearch(QFrame):
|
class GuiDocEditSearch(QFrame):
|
||||||
|
"""The Embedded Document Search/Replace Feature
|
||||||
|
|
||||||
|
Only used by DocEditor, and is at a fixed position in the
|
||||||
|
QTextEdit's viewport.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, docEditor: GuiDocEditor) -> None:
|
def __init__(self, docEditor: GuiDocEditor) -> None:
|
||||||
super().__init__(parent=docEditor)
|
super().__init__(parent=docEditor)
|
||||||
@@ -2756,14 +2746,12 @@ class GuiDocEditSearch(QFrame):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# The Embedded Document Header
|
|
||||||
# Only used by DocEditor, and is at a fixed position in the QTextEdit's viewport
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class GuiDocEditHeader(QWidget):
|
class GuiDocEditHeader(QWidget):
|
||||||
|
"""The Embedded Document Header
|
||||||
|
|
||||||
|
Only used by DocEditor, and is at a fixed position in the
|
||||||
|
QTextEdit's viewport.
|
||||||
|
"""
|
||||||
|
|
||||||
closeDocumentRequest = pyqtSignal()
|
closeDocumentRequest = pyqtSignal()
|
||||||
toggleToolBarRequest = pyqtSignal()
|
toggleToolBarRequest = pyqtSignal()
|
||||||
@@ -2979,14 +2967,12 @@ class GuiDocEditHeader(QWidget):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# The Embedded Document Footer
|
|
||||||
# Only used by DocEditor, and is at a fixed position in the QTextEdit's viewport
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class GuiDocEditFooter(QWidget):
|
class GuiDocEditFooter(QWidget):
|
||||||
|
"""The Embedded Document Footer
|
||||||
|
|
||||||
|
Only used by DocEditor, and is at a fixed position in the
|
||||||
|
QTextEdit's viewport.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, parent: QWidget) -> None:
|
def __init__(self, parent: QWidget) -> None:
|
||||||
super().__init__(parent=parent)
|
super().__init__(parent=parent)
|
||||||
@@ -3169,5 +3155,3 @@ class GuiDocEditFooter(QWidget):
|
|||||||
wText = self._trWordCount.format("0", "+0")
|
wText = self._trWordCount.format("0", "+0")
|
||||||
self.wordsText.setText(wText)
|
self.wordsText.setText(wText)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -610,12 +610,12 @@ class GuiDocViewHistory:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# The Embedded Document Header
|
|
||||||
# Only used by DocViewer, and is at a fixed position in the QTextBrowser's viewport
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class GuiDocViewHeader(QWidget):
|
class GuiDocViewHeader(QWidget):
|
||||||
|
"""The Embedded Document Header
|
||||||
|
|
||||||
|
Only used by DocViewer, and is at a fixed position in the
|
||||||
|
QTextBrowser's viewport.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, docViewer: GuiDocViewer) -> None:
|
def __init__(self, docViewer: GuiDocViewer) -> None:
|
||||||
super().__init__(parent=docViewer)
|
super().__init__(parent=docViewer)
|
||||||
@@ -832,12 +832,12 @@ class GuiDocViewHeader(QWidget):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# The Embedded Document Footer
|
|
||||||
# Only used by DocViewer, and is at a fixed position in the QTextBrowser's viewport
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class GuiDocViewFooter(QWidget):
|
class GuiDocViewFooter(QWidget):
|
||||||
|
"""The Embedded Document Footer
|
||||||
|
|
||||||
|
Only used by DocViewer, and is at a fixed position in the
|
||||||
|
QTextBrowser's viewport.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, docViewer: GuiDocViewer) -> None:
|
def __init__(self, docViewer: GuiDocViewer) -> None:
|
||||||
super().__init__(parent=docViewer)
|
super().__init__(parent=docViewer)
|
||||||
|
|||||||
@@ -46,12 +46,11 @@ STYLES_MIN_TOOLBUTTON = "minimalToolButton"
|
|||||||
STYLES_BIG_TOOLBUTTON = "bigToolButton"
|
STYLES_BIG_TOOLBUTTON = "bigToolButton"
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# Gui Theme Class
|
|
||||||
# Handles the look and feel of novelWriter
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class GuiTheme:
|
class GuiTheme:
|
||||||
|
"""Gui Theme Class
|
||||||
|
|
||||||
|
Handles the look and feel of novelWriter.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
|
|
||||||
@@ -482,12 +481,6 @@ class GuiTheme:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# End Class GuiTheme
|
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
|
||||||
# Icons Class
|
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
class GuiIcons:
|
class GuiIcons:
|
||||||
"""The icon class manages the content of the assets/icons folder,
|
"""The icon class manages the content of the assets/icons folder,
|
||||||
@@ -796,9 +789,8 @@ class GuiIcons:
|
|||||||
return self._noIcon
|
return self._noIcon
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================================== #
|
# Module Functions
|
||||||
# Module Functions
|
# ================
|
||||||
# =============================================================================================== #
|
|
||||||
|
|
||||||
|
|
||||||
def _sortTheme(data: tuple[str, str]) -> str:
|
def _sortTheme(data: tuple[str, str]) -> str:
|
||||||
|
|||||||
+3
-8
@@ -23,10 +23,6 @@ from __future__ import annotations
|
|||||||
from PyQt5.QtGui import QPixmap
|
from PyQt5.QtGui import QPixmap
|
||||||
from PyQt5.QtWidgets import QWidget
|
from PyQt5.QtWidgets import QWidget
|
||||||
|
|
||||||
# =========================================================================== #
|
|
||||||
# Mock GUI
|
|
||||||
# =========================================================================== #
|
|
||||||
|
|
||||||
|
|
||||||
class MockGuiMain(QWidget):
|
class MockGuiMain(QWidget):
|
||||||
|
|
||||||
@@ -87,10 +83,9 @@ class MockApp:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# =========================================================================== #
|
# Error Functions
|
||||||
# Error Functions
|
# ===============
|
||||||
# Mock functions that will raise errors instead.
|
# Mock functions that will raise errors instead.
|
||||||
# =========================================================================== #
|
|
||||||
|
|
||||||
def causeOSError(*args, **kwargs):
|
def causeOSError(*args, **kwargs):
|
||||||
raise OSError("Mock OSError")
|
raise OSError("Mock OSError")
|
||||||
|
|||||||
Reference in New Issue
Block a user