Update linting for main code
This commit is contained in:
@@ -21,7 +21,7 @@ General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
""" # noqa
|
||||
from __future__ import annotations
|
||||
|
||||
from novelwriter.enum import nwComment
|
||||
|
||||
@@ -22,7 +22,7 @@ General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
""" # noqa
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
@@ -74,9 +74,11 @@ def preProcessText(text: str, keepHeaders: bool = True) -> list[str]:
|
||||
|
||||
|
||||
def standardCounter(text: str) -> tuple[int, int, int]:
|
||||
"""A counter that counts paragraphs, words and characters.
|
||||
This is the standard counter that includes headings in the word and
|
||||
character counts.
|
||||
"""Return a standard count.
|
||||
|
||||
A counter that counts paragraphs, words and characters. This is the
|
||||
standard counter that includes headings in the word and character
|
||||
counts.
|
||||
"""
|
||||
cCount = 0
|
||||
wCount = 0
|
||||
@@ -124,7 +126,9 @@ def standardCounter(text: str) -> tuple[int, int, int]:
|
||||
|
||||
|
||||
def bodyTextCounter(text: str) -> tuple[int, int, int]:
|
||||
"""A counter that counts body text words, characters, and characters
|
||||
"""Return a body text count.
|
||||
|
||||
A counter that counts body text words, characters, and characters
|
||||
without white spaces.
|
||||
"""
|
||||
wCount = 0
|
||||
|
||||
@@ -21,7 +21,7 @@ General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
""" # noqa
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
@@ -32,6 +32,7 @@ from novelwriter.constants import nwRegEx, nwUnicode
|
||||
|
||||
|
||||
class RegExPatterns:
|
||||
"""Compiled RegEx Patterns."""
|
||||
|
||||
AMBIGUOUS = (nwUnicode.U_APOS, nwUnicode.U_RSQUO)
|
||||
|
||||
@@ -132,6 +133,7 @@ REGEX_PATTERNS = RegExPatterns()
|
||||
|
||||
|
||||
class DialogParser:
|
||||
"""A callable parser for finding dialog regions in text."""
|
||||
|
||||
__slots__ = (
|
||||
"_alternate", "_breakD", "_breakQ", "_dialog", "_enabled", "_mode",
|
||||
@@ -147,7 +149,6 @@ class DialogParser:
|
||||
self._breakD = None
|
||||
self._breakQ = None
|
||||
self._mode = ""
|
||||
return
|
||||
|
||||
@property
|
||||
def enabled(self) -> bool:
|
||||
@@ -174,8 +175,6 @@ class DialogParser:
|
||||
self._narrator = narrator
|
||||
self._mode = f" {narrator}"
|
||||
|
||||
return
|
||||
|
||||
def __call__(self, text: str) -> list[tuple[int, int]]:
|
||||
"""Caller wrapper for dialogue processing."""
|
||||
temp: list[int] = []
|
||||
|
||||
Reference in New Issue
Block a user