Clean up class initialisation

This commit is contained in:
Veronica Berglyd Olsen
2022-10-11 23:17:58 +02:00
parent 1f05e90266
commit 5d6778be57
36 changed files with 109 additions and 109 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ from novelwriter.common import isHandle, sha256sum
logger = logging.getLogger(__name__)
class NWDoc():
class NWDoc:
def __init__(self, theProject, theHandle):
+1 -1
View File
@@ -36,7 +36,7 @@ from novelwriter.constants import nwLabels, trConst
logger = logging.getLogger(__name__)
class NWItem():
class NWItem:
def __init__(self, theProject):
+1 -1
View File
@@ -63,7 +63,7 @@ VALID_MAP = {
}
class OptionState():
class OptionState:
def __init__(self, theProject):
self.theProject = theProject
+1 -1
View File
@@ -52,7 +52,7 @@ from novelwriter.constants import trConst, nwFiles, nwLabels
logger = logging.getLogger(__name__)
class NWProject():
class NWProject:
FILE_VERSION = "1.4" # The current project file format version
+1 -1
View File
@@ -33,7 +33,7 @@ from novelwriter.error import logException
logger = logging.getLogger(__name__)
class NWSpellEnchant():
class NWSpellEnchant:
def __init__(self):
+1 -1
View File
@@ -37,7 +37,7 @@ from novelwriter.common import checkInt, minmax, simplified
logger = logging.getLogger(__name__)
class NWStatus():
class NWStatus:
STATUS = 1
IMPORT = 2
+2 -2
View File
@@ -38,7 +38,7 @@ class ToHtml(Tokenizer):
M_EBOOK = 2 # Tweak output for converting to epub
def __init__(self, theProject):
Tokenizer.__init__(self, theProject)
super().__init__(theProject)
self._genMode = self.M_EXPORT
self._cssStyles = True
@@ -107,7 +107,7 @@ class ToHtml(Tokenizer):
"""Extend the auto-replace to also properly encode some unicode
characters into their respective HTML entities.
"""
Tokenizer.doPreProcessing(self)
super().doPreProcessing()
self._theText = self._theText.translate(self._trMap)
return
+1 -1
View File
@@ -37,7 +37,7 @@ class ToMarkdown(Tokenizer):
M_GH = 1 # GitHub Markdown
def __init__(self, theProject):
Tokenizer.__init__(self, theProject)
super().__init__(theProject)
self._genMode = self.M_STD
self._fullMD = []
+4 -4
View File
@@ -89,7 +89,7 @@ M_DEL = ~X_DEL
class ToOdt(Tokenizer):
def __init__(self, theProject, isFlat):
Tokenizer.__init__(self, theProject)
super().__init__(theProject)
self._isFlat = isFlat # Flat: .fodt, otherwise .odt
@@ -994,7 +994,7 @@ class ToOdt(Tokenizer):
# Auto-Style Classes
# =============================================================================================== #
class ODTParagraphStyle():
class ODTParagraphStyle:
"""Wrapper class for the paragraph style setting used by the
exporter. Only the used settings are exposed here to keep the class
minimal and fast.
@@ -1208,7 +1208,7 @@ class ODTParagraphStyle():
# END Class ODTParagraphStyle
class ODTTextStyle():
class ODTTextStyle:
"""Wrapper class for the text style setting used by the exporter.
Only the used settings are exposed here to keep the class minimal
and fast.
@@ -1297,7 +1297,7 @@ X_SPAN_TEXT = 2
X_SPAN_SING = 3
class XMLParagraph():
class XMLParagraph:
"""This is a helper class to manage the text content of a single
XML element using mixed content tags.
+1 -1
View File
@@ -38,7 +38,7 @@ from novelwriter.core.item import NWItem
logger = logging.getLogger(__name__)
class NWTree():
class NWTree:
MAX_DEPTH = 1000 # Cap of tree traversing for loops