From 2fcde84379dcd77b278bbe516d1e6cf61b49e9c4 Mon Sep 17 00:00:00 2001 From: Saeed Rasooli Date: Thu, 3 Oct 2024 05:58:34 +0330 Subject: [PATCH] fix ruff --preview errors --- pyglossary/plugins/dict_org_source.py | 3 ++- pyglossary/plugins/lingoes_ldf.py | 3 ++- pyglossary/text_utils.py | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyglossary/plugins/dict_org_source.py b/pyglossary/plugins/dict_org_source.py index 7a165fbe5..c0d7922d2 100644 --- a/pyglossary/plugins/dict_org_source.py +++ b/pyglossary/plugins/dict_org_source.py @@ -54,7 +54,8 @@ def open(self, filename: str) -> None: # TODO: add another bool flag to only remove html tags that are not # supported by GtkTextView - def _defiEscapeFunc(self, defi: str) -> str: + @staticmethod + def _defiEscapeFunc(defi: str) -> str: return defi.replace("\r", "") def write(self) -> "Generator[None, EntryType, None]": diff --git a/pyglossary/plugins/lingoes_ldf.py b/pyglossary/plugins/lingoes_ldf.py index b1595d6d8..b6c580667 100644 --- a/pyglossary/plugins/lingoes_ldf.py +++ b/pyglossary/plugins/lingoes_ldf.py @@ -142,7 +142,8 @@ def finish(self) -> None: def open(self, filename: str) -> None: self._filename = filename - def _defiEscapeFunc(self, defi: str) -> str: + @staticmethod + def _defiEscapeFunc(defi: str) -> str: return defi.replace("\n", "
") def write(self) -> "Generator[None, EntryType, None]": diff --git a/pyglossary/text_utils.py b/pyglossary/text_utils.py index 25006bdf5..15e983f17 100644 --- a/pyglossary/text_utils.py +++ b/pyglossary/text_utils.py @@ -181,5 +181,3 @@ def replacePostSpaceChar(st: str, ch: str) -> str: .replace(f"{ch} ", f"{ch} ") .removesuffix(" ") ) - -