Remove banner comments

This commit is contained in:
Veronica Berglyd Olsen
2024-05-10 16:14:47 +02:00
parent 3f4538a60e
commit 1ff9fea378
7 changed files with 57 additions and 97 deletions
+7 -9
View File
@@ -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,
+5 -6
View File
@@ -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
-8
View File
@@ -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:
+26 -42
View File
@@ -78,7 +78,7 @@ class _SelectAction(Enum):
KEEP_POSITION = 2 KEEP_POSITION = 2
MOVE_AFTER = 3 MOVE_AFTER = 3
class GuiDocEditor(QPlainTextEdit): class GuiDocEditor(QPlainTextEdit):
"""Gui Widget: Main Document Editor""" """Gui Widget: Main Document Editor"""
@@ -2129,8 +2129,6 @@ class GuiDocEditor(QPlainTextEdit):
self._doReplace = False self._doReplace = False
return return
class MetaCompleter(QMenu): class MetaCompleter(QMenu):
"""GuiWidget: Meta Completer Menu """GuiWidget: Meta Completer Menu
@@ -2208,15 +2206,13 @@ class MetaCompleter(QMenu):
self.complete.emit(pos, length, value) self.complete.emit(pos, length, value)
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__()
@@ -2249,8 +2245,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
@@ -2258,15 +2252,13 @@ 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)
@@ -2391,15 +2383,13 @@ 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)
@@ -2755,15 +2745,13 @@ class GuiDocEditSearch(QFrame):
self.searchBox.setPalette(qPalette) self.searchBox.setPalette(qPalette)
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()
@@ -2978,15 +2966,13 @@ class GuiDocEditHeader(QWidget):
self.docEditor.requestProjectItemSelected.emit(self._docHandle or "", True) self.docEditor.requestProjectItemSelected.emit(self._docHandle or "", True)
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
+10 -10
View File
@@ -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)
+6 -14
View File
@@ -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
View File
@@ -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")