From 567a0187f3ac3f461f84be118ddc561168e8ec74 Mon Sep 17 00:00:00 2001 From: un-pogaz <46523284+un-pogaz@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:14:20 +0100 Subject: [PATCH] unnecessary regex (manual) ruff 'RUF055' --- recipes/brewiarz.recipe | 1 - recipes/respekt_magazine.recipe | 1 - src/calibre/ebooks/txt/textileml.py | 2 +- src/calibre/gui2/actions/catalog.py | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/recipes/brewiarz.recipe b/recipes/brewiarz.recipe index bccc858010..98a3413440 100644 --- a/recipes/brewiarz.recipe +++ b/recipes/brewiarz.recipe @@ -5,7 +5,6 @@ from __future__ import print_function __license__ = 'GPL v3' import datetime -import re from calibre.web.feeds.news import BasicNewsRecipe diff --git a/recipes/respekt_magazine.recipe b/recipes/respekt_magazine.recipe index d8da4aa66f..13f3cf7212 100644 --- a/recipes/respekt_magazine.recipe +++ b/recipes/respekt_magazine.recipe @@ -6,7 +6,6 @@ __license__ = 'GNU General Public License v3 - http://www.gnu.org/copyleft/gpl.html' __copyright__ = 'tomashnyk@gmail.com' -import re # This imports the version bundled with Calibre import lxml diff --git a/src/calibre/ebooks/txt/textileml.py b/src/calibre/ebooks/txt/textileml.py index 210505b186..36a27366e2 100644 --- a/src/calibre/ebooks/txt/textileml.py +++ b/src/calibre/ebooks/txt/textileml.py @@ -116,7 +116,7 @@ class TextileMLizer(OEB2HTML): # blank paragraph text = re.sub(r'\n(p.*\.)\n', r'\n\1 \n\n', text) # blank paragraph - text = re.sub('\n\xa0', r'\np. ', text) + text = text.replace('\n\xa0', '\np. ') # blank paragraph text = re.sub('\np[<>=]{1,2}?\\. \xa0', r'\np. ', text) text = re.sub(r'(^|\n)(p.*\. ?\n)(p.*\.)', r'\1\3', text) diff --git a/src/calibre/gui2/actions/catalog.py b/src/calibre/gui2/actions/catalog.py index 97c79b43f5..739823e49b 100644 --- a/src/calibre/gui2/actions/catalog.py +++ b/src/calibre/gui2/actions/catalog.py @@ -6,7 +6,6 @@ __copyright__ = '2010, Kovid Goyal ' __docformat__ = 'restructuredtext en' import os -import re import shutil from qt.core import QModelIndex