additional noqa work (extra-edit)

This commit is contained in:
un-pogaz 2025-01-24 11:14:13 +01:00
parent d08949b012
commit 2357c1fc48
13 changed files with 14 additions and 17 deletions

View File

@ -61,7 +61,7 @@ class MediaDaumRecipe(BasicNewsRecipe):
lambda match: '<em>'),
(re.compile(r'<i>(<br[^>]*>[ \t\r\n]*)*', re.DOTALL | re.IGNORECASE),
lambda match: '<i>'),
(re.compile(u'(<br[^>]*>[ \t\r\n]*)*(\u25B6|\u25CF|\u261E|\u24D2|\(c\))*\[[^\]]*(\u24D2|\(c\)|\uAE30\uC0AC|\uC778\uAE30[^\]]*\uB274\uC2A4)[^\]]*\].*</div>', re.DOTALL | re.IGNORECASE), # noqa: E501, W605
(re.compile(u'(<br[^>]*>[ \t\r\n]*)*(\u25B6|\u25CF|\u261E|\u24D2|\\(c\\))*\\[[^\\]]*(\u24D2|\\(c\\)|\uAE30\uC0AC|\uC778\uAE30[^\\]]*\uB274\uC2A4)[^\\]]*\\].*</div>', re.DOTALL | re.IGNORECASE), # noqa: E501
lambda match: '</div>'),
]

View File

@ -7,7 +7,6 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import datetime
import json
import re
from pprint import pprint # noqa: F401
from calibre import strftime
from calibre.ebooks.BeautifulSoup import Tag

View File

@ -7,7 +7,6 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import datetime
import json
import re
from pprint import pprint # noqa: F401
from calibre import strftime
from calibre.ebooks.BeautifulSoup import Tag

View File

@ -1997,7 +1997,7 @@ if __name__ == '__main__':
try:
subprocess.check_call(['python', '-c', textwrap.dedent(
'''
import time, sys, init_calibre
import time, sys, init_calibre # noqa: F401
st = time.time()
import calibre.customize.builtins
t = time.time() - st

View File

@ -151,9 +151,10 @@ class PDFOutput(OutputFormatPlugin):
# Ensure Qt is setup to be used with WebEngine
# specialize_options is called early enough in the pipeline
# that hopefully no Qt application has been constructed as yet
from qt.webengine import QWebEnginePage # noqa: I001, F401
from qt.webengine import QWebEnginePage # noqa: F401
from calibre.gui2 import must_use_qt
from calibre.utils.webengine import setup_fake_protocol, setup_default_profile
from calibre.utils.webengine import setup_default_profile, setup_fake_protocol
setup_fake_protocol()
must_use_qt()
setup_default_profile()

View File

@ -543,5 +543,5 @@ class EmailMixin: # {{{
if __name__ == '__main__':
from qt.core import QApplication
app = QApplication([])
app = QApplication([]) # noqa: F841
print(select_recipients())

View File

@ -165,7 +165,7 @@ class TextureChooser(QDialog):
if __name__ == '__main__':
app = QApplication([])
app = QApplication([]) # noqa: F841
d = TextureChooser()
d.exec()
print(d.texture)

View File

@ -271,7 +271,7 @@ class Check(QSplitter):
def main():
from calibre.gui2 import Application
from calibre.gui2.tweak_book.boss import get_container
app = Application([])
app = Application([]) # noqa: F841
path = sys.argv[-1]
container = get_container(path)
d = Check()

View File

@ -519,7 +519,7 @@ def main(args=sys.argv):
attr = 'ebook_diff'
else:
attr = 'file_diff'
app = Application([])
app = Application([]) # noqa: F841
d = Diff(show_as_window=True)
func = getattr(d, attr)
QTimer.singleShot(0, lambda : func(left, right))

View File

@ -516,7 +516,7 @@ class NewBook(Dialog): # {{{
if __name__ == '__main__':
app = QApplication([])
app = QApplication([]) # noqa: F841
from calibre.gui2.tweak_book import set_current_container
from calibre.gui2.tweak_book.boss import get_container
set_current_container(get_container(sys.argv[-1]))

View File

@ -38,7 +38,7 @@ def determined_remove_dir(x):
shutil.rmtree(x)
return
except:
import os
import os # noqa
if os.path.exists(x):
# In case some other program has one of the temp files open.
import time

View File

@ -300,8 +300,7 @@ def main(args):
if __name__ == '__main__':
try:
import init_calibre
init_calibre
import init_calibre # noqa: F401
except ImportError:
pass
import sys

View File

@ -121,7 +121,7 @@ history_length(2000) #value of -1 means no limit
import atexit
import readline
import pyreadline.unicode_helper
import pyreadline.unicode_helper # noqa: F401
# Normally the codepage for pyreadline is set to be sys.stdout.encoding
# if you need to change this uncomment the following line
# pyreadline.unicode_helper.pyreadline_codepage="utf8"
@ -172,8 +172,7 @@ def simple_repl(user_ns={}):
setup_pyreadline()
else:
try:
import rlcompleter # noqa: I001, F401
import readline
import readline, rlcompleter # noqa: I001, E401, F401
readline.parse_and_bind("tab: complete")
except ImportError:
pass