mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
additional noqa work (extra-edit)
This commit is contained in:
parent
d08949b012
commit
2357c1fc48
@ -61,7 +61,7 @@ class MediaDaumRecipe(BasicNewsRecipe):
|
|||||||
lambda match: '<em>'),
|
lambda match: '<em>'),
|
||||||
(re.compile(r'<i>(<br[^>]*>[ \t\r\n]*)*', re.DOTALL | re.IGNORECASE),
|
(re.compile(r'<i>(<br[^>]*>[ \t\r\n]*)*', re.DOTALL | re.IGNORECASE),
|
||||||
lambda match: '<i>'),
|
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>'),
|
lambda match: '</div>'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
|||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
from pprint import pprint # noqa: F401
|
|
||||||
|
|
||||||
from calibre import strftime
|
from calibre import strftime
|
||||||
from calibre.ebooks.BeautifulSoup import Tag
|
from calibre.ebooks.BeautifulSoup import Tag
|
||||||
|
@ -7,7 +7,6 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
|||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
from pprint import pprint # noqa: F401
|
|
||||||
|
|
||||||
from calibre import strftime
|
from calibre import strftime
|
||||||
from calibre.ebooks.BeautifulSoup import Tag
|
from calibre.ebooks.BeautifulSoup import Tag
|
||||||
|
@ -1997,7 +1997,7 @@ if __name__ == '__main__':
|
|||||||
try:
|
try:
|
||||||
subprocess.check_call(['python', '-c', textwrap.dedent(
|
subprocess.check_call(['python', '-c', textwrap.dedent(
|
||||||
'''
|
'''
|
||||||
import time, sys, init_calibre
|
import time, sys, init_calibre # noqa: F401
|
||||||
st = time.time()
|
st = time.time()
|
||||||
import calibre.customize.builtins
|
import calibre.customize.builtins
|
||||||
t = time.time() - st
|
t = time.time() - st
|
||||||
|
@ -151,9 +151,10 @@ class PDFOutput(OutputFormatPlugin):
|
|||||||
# Ensure Qt is setup to be used with WebEngine
|
# Ensure Qt is setup to be used with WebEngine
|
||||||
# specialize_options is called early enough in the pipeline
|
# specialize_options is called early enough in the pipeline
|
||||||
# that hopefully no Qt application has been constructed as yet
|
# 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.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()
|
setup_fake_protocol()
|
||||||
must_use_qt()
|
must_use_qt()
|
||||||
setup_default_profile()
|
setup_default_profile()
|
||||||
|
@ -543,5 +543,5 @@ class EmailMixin: # {{{
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from qt.core import QApplication
|
from qt.core import QApplication
|
||||||
app = QApplication([])
|
app = QApplication([]) # noqa: F841
|
||||||
print(select_recipients())
|
print(select_recipients())
|
||||||
|
@ -165,7 +165,7 @@ class TextureChooser(QDialog):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app = QApplication([])
|
app = QApplication([]) # noqa: F841
|
||||||
d = TextureChooser()
|
d = TextureChooser()
|
||||||
d.exec()
|
d.exec()
|
||||||
print(d.texture)
|
print(d.texture)
|
||||||
|
@ -271,7 +271,7 @@ class Check(QSplitter):
|
|||||||
def main():
|
def main():
|
||||||
from calibre.gui2 import Application
|
from calibre.gui2 import Application
|
||||||
from calibre.gui2.tweak_book.boss import get_container
|
from calibre.gui2.tweak_book.boss import get_container
|
||||||
app = Application([])
|
app = Application([]) # noqa: F841
|
||||||
path = sys.argv[-1]
|
path = sys.argv[-1]
|
||||||
container = get_container(path)
|
container = get_container(path)
|
||||||
d = Check()
|
d = Check()
|
||||||
|
@ -519,7 +519,7 @@ def main(args=sys.argv):
|
|||||||
attr = 'ebook_diff'
|
attr = 'ebook_diff'
|
||||||
else:
|
else:
|
||||||
attr = 'file_diff'
|
attr = 'file_diff'
|
||||||
app = Application([])
|
app = Application([]) # noqa: F841
|
||||||
d = Diff(show_as_window=True)
|
d = Diff(show_as_window=True)
|
||||||
func = getattr(d, attr)
|
func = getattr(d, attr)
|
||||||
QTimer.singleShot(0, lambda : func(left, right))
|
QTimer.singleShot(0, lambda : func(left, right))
|
||||||
|
@ -516,7 +516,7 @@ class NewBook(Dialog): # {{{
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app = QApplication([])
|
app = QApplication([]) # noqa: F841
|
||||||
from calibre.gui2.tweak_book import set_current_container
|
from calibre.gui2.tweak_book import set_current_container
|
||||||
from calibre.gui2.tweak_book.boss import get_container
|
from calibre.gui2.tweak_book.boss import get_container
|
||||||
set_current_container(get_container(sys.argv[-1]))
|
set_current_container(get_container(sys.argv[-1]))
|
||||||
|
@ -38,7 +38,7 @@ def determined_remove_dir(x):
|
|||||||
shutil.rmtree(x)
|
shutil.rmtree(x)
|
||||||
return
|
return
|
||||||
except:
|
except:
|
||||||
import os
|
import os # noqa
|
||||||
if os.path.exists(x):
|
if os.path.exists(x):
|
||||||
# In case some other program has one of the temp files open.
|
# In case some other program has one of the temp files open.
|
||||||
import time
|
import time
|
||||||
|
@ -300,8 +300,7 @@ def main(args):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
import init_calibre
|
import init_calibre # noqa: F401
|
||||||
init_calibre
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
import sys
|
import sys
|
||||||
|
@ -121,7 +121,7 @@ history_length(2000) #value of -1 means no limit
|
|||||||
import atexit
|
import atexit
|
||||||
import readline
|
import readline
|
||||||
|
|
||||||
import pyreadline.unicode_helper
|
import pyreadline.unicode_helper # noqa: F401
|
||||||
# Normally the codepage for pyreadline is set to be sys.stdout.encoding
|
# Normally the codepage for pyreadline is set to be sys.stdout.encoding
|
||||||
# if you need to change this uncomment the following line
|
# if you need to change this uncomment the following line
|
||||||
# pyreadline.unicode_helper.pyreadline_codepage="utf8"
|
# pyreadline.unicode_helper.pyreadline_codepage="utf8"
|
||||||
@ -172,8 +172,7 @@ def simple_repl(user_ns={}):
|
|||||||
setup_pyreadline()
|
setup_pyreadline()
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
import rlcompleter # noqa: I001, F401
|
import readline, rlcompleter # noqa: I001, E401, F401
|
||||||
import readline
|
|
||||||
readline.parse_and_bind("tab: complete")
|
readline.parse_and_bind("tab: complete")
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user