Remove all END Class comments
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user