mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove more exclusions
This commit is contained in:
parent
68f8d4925e
commit
ddd580c85c
@ -49,10 +49,7 @@ unfixable = ['PIE794', 'ISC001']
|
||||
"recipes/*" = ['UP']
|
||||
"manual/plugin_examples/*" = ['UP']
|
||||
"setup/changelog.py" = ['ISC001']
|
||||
"setup/commands.py" = ['RUF022']
|
||||
"src/calibre/*" = ['UP031']
|
||||
"src/calibre/customize/__init__.py" = ['RET501']
|
||||
"src/calibre/devices/interface.py" = ['RET501']
|
||||
"src/calibre/devices/kobo/driver.py" = ['E116']
|
||||
"src/calibre/ebooks/unihandecode/*codepoints.py" = ['E501']
|
||||
"src/calibre/ebooks/metadata/sources/*" = ['UP']
|
||||
@ -61,8 +58,6 @@ unfixable = ['PIE794', 'ISC001']
|
||||
"src/calibre/gui2/store/stores/*" = ['UP']
|
||||
"src/calibre/gui2/tts/manager.py" = ['UP037']
|
||||
"src/calibre/utils/copy_files.py" = ['UP037']
|
||||
"src/calibre/utils/smartypants.py" = ['RUF055']
|
||||
"src/calibre/web/feeds/news.py" = ['RET501']
|
||||
"src/qt/*.py" = ['I', 'E302']
|
||||
"src/qt/*.pyi" = ['I']
|
||||
|
||||
|
@ -11,7 +11,7 @@ import json
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from setup import Command, build_cache_dir, dump_json, edit_file, require_clean_git, require_git_master
|
||||
from setup import Command, build_cache_dir, dump_json, edit_file
|
||||
|
||||
|
||||
class Message:
|
||||
|
@ -6,21 +6,58 @@ __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
__all__ = [
|
||||
'pot', 'translations', 'get_translations', 'iso_data', 'iso639', 'iso3166',
|
||||
'build', 'mathjax', 'man_pages',
|
||||
'gui',
|
||||
'bootstrap',
|
||||
'build',
|
||||
'build_dep',
|
||||
'cacerts',
|
||||
'check',
|
||||
'develop',
|
||||
'export_packages',
|
||||
'extdev',
|
||||
'get_translations',
|
||||
'git_version',
|
||||
'develop', 'install',
|
||||
'rapydscript', 'cacerts', 'recent_uas', 'resources',
|
||||
'check', 'test', 'test_rs', 'upgrade_source_code',
|
||||
'sdist', 'bootstrap', 'extdev',
|
||||
'manual', 'tag_release',
|
||||
'upload_to_server',
|
||||
'gui',
|
||||
'hyphenation',
|
||||
'install',
|
||||
'iso639',
|
||||
'iso3166',
|
||||
'iso_data',
|
||||
'liberation_fonts',
|
||||
'linux',
|
||||
'linux64',
|
||||
'linuxarm64',
|
||||
'man_pages',
|
||||
'manual',
|
||||
'mathjax',
|
||||
'osx',
|
||||
'piper_voices',
|
||||
'pot',
|
||||
'publish',
|
||||
'publish_betas',
|
||||
'publish_preview',
|
||||
'rapydscript',
|
||||
'recent_uas',
|
||||
'resources',
|
||||
'reupload',
|
||||
'sdist',
|
||||
'stage1',
|
||||
'stage2',
|
||||
'stage3',
|
||||
'stage4',
|
||||
'stage5',
|
||||
'stylelint',
|
||||
'tag_release',
|
||||
'test',
|
||||
'test_rs',
|
||||
'translations',
|
||||
'upgrade_source_code',
|
||||
'upload_demo',
|
||||
'upload_installers',
|
||||
'upload_user_manual', 'upload_demo', 'reupload',
|
||||
'stage1', 'stage2', 'stage3', 'stage4', 'stage5', 'publish', 'publish_betas', 'publish_preview',
|
||||
'linux', 'linux64', 'linuxarm64', 'win', 'win64', 'osx', 'build_dep',
|
||||
'export_packages', 'hyphenation', 'piper_voices', 'liberation_fonts', 'stylelint', 'xwin',
|
||||
'upload_to_server',
|
||||
'upload_user_manual',
|
||||
'win',
|
||||
'win64',
|
||||
'xwin',
|
||||
]
|
||||
|
||||
from setup.installers import OSX, BuildDep, ExportPackages, ExtDev, Linux, Linux64, LinuxArm64, Win, Win64
|
||||
|
@ -474,7 +474,7 @@ class MetadataReaderPlugin(Plugin): # {{{
|
||||
in :attr:`file_types`.
|
||||
:return: A :class:`calibre.ebooks.metadata.book.Metadata` object
|
||||
'''
|
||||
return None
|
||||
return
|
||||
|
||||
# }}}
|
||||
|
||||
|
@ -138,7 +138,7 @@ class DevicePlugin(Plugin):
|
||||
@classmethod
|
||||
def get_open_popup_message(self):
|
||||
' GUI displays this as a non-modal popup. Should be an instance of OpenPopupMessage '
|
||||
return None
|
||||
return
|
||||
|
||||
# Device detection {{{
|
||||
def test_bcd(self, bcdDevice, bcd):
|
||||
@ -631,7 +631,7 @@ class DevicePlugin(Plugin):
|
||||
This method can be called on the GUI thread. A driver that implements
|
||||
this method must be thread safe.
|
||||
'''
|
||||
return None
|
||||
return
|
||||
|
||||
def start_plugin(self):
|
||||
'''
|
||||
|
@ -493,7 +493,7 @@ def smartyPants(text, attr='1'):
|
||||
if not in_pre:
|
||||
t = processEscapes(t)
|
||||
|
||||
t = re.sub(r'"', '"', t)
|
||||
t = t.replace('"', '"')
|
||||
t = dashes_func(t)
|
||||
t = ellipses_func(t)
|
||||
# Note: backticks need to be processed before quotes.
|
||||
@ -548,10 +548,10 @@ def educateQuotes(text):
|
||||
text = re.sub(r''''"(?=\w)''', '''‘“''', text)
|
||||
text = re.sub(r'''""(?=\w)''', '''““''', text)
|
||||
text = re.sub(r'''''(?=\w)''', '''‘‘''', text)
|
||||
text = re.sub(r'''\"\'''', '''”’''', text)
|
||||
text = re.sub(r'''\'\"''', '''’”''', text)
|
||||
text = re.sub(r'''""''', '''””''', text)
|
||||
text = re.sub(r"""''""", '''’’''', text)
|
||||
text = text.replace('"\'', '”’')
|
||||
text = text.replace('\'"', '''’”''')
|
||||
text = text.replace('""', '””')
|
||||
text = text.replace(r"""''""", '''’’''')
|
||||
|
||||
# Special case for decade abbreviations (the '80s --> ’80s):
|
||||
# See http://practicaltypography.com/apostrophes.html
|
||||
@ -612,7 +612,7 @@ def educateQuotes(text):
|
||||
text = closing_single_quotes_regex.sub(r'''\1’\2''', text)
|
||||
|
||||
# Any remaining single quotes should be opening ones:
|
||||
text = re.sub(r"""'""", r'''‘''', text)
|
||||
text = text.replace("'", '‘')
|
||||
|
||||
# Get most opening double quotes:
|
||||
opening_double_quotes_regex = re.compile(r'''
|
||||
@ -648,7 +648,7 @@ def educateQuotes(text):
|
||||
text = text[:-1] + '”'
|
||||
|
||||
# Any remaining quotes should be opening ones.
|
||||
text = re.sub(r'"', r'''“''', text)
|
||||
text = text.replace('"', '“')
|
||||
|
||||
return text
|
||||
|
||||
@ -662,8 +662,8 @@ def educateBackticks(text):
|
||||
Example output: “Isn't this fun?”
|
||||
'''
|
||||
|
||||
text = re.sub(r'''``''', r'''“''', text)
|
||||
text = re.sub(r"""''""", r'''”''', text)
|
||||
text = text.replace('``', '“')
|
||||
text = text.replace("''", '”')
|
||||
return text
|
||||
|
||||
|
||||
@ -677,8 +677,8 @@ def educateSingleBackticks(text):
|
||||
Example output: ‘Isn’t this fun?’
|
||||
'''
|
||||
|
||||
text = re.sub(r'''`''', r'''‘''', text)
|
||||
text = re.sub(r"""'""", r'''’''', text)
|
||||
text = text.replace('`', '‘')
|
||||
text = text.replace("'", '’')
|
||||
return text
|
||||
|
||||
|
||||
@ -690,8 +690,8 @@ def educateDashes(text):
|
||||
an em-dash HTML entity.
|
||||
'''
|
||||
|
||||
text = re.sub(r'''---''', r'''–''', text) # en (yes, backwards)
|
||||
text = re.sub(r'''--''', r'''—''', text) # em (yes, backwards)
|
||||
text = text.replace('---', '–') # en (yes, backwards)
|
||||
text = text.replace('--', '—') # em (yes, backwards)
|
||||
return text
|
||||
|
||||
|
||||
@ -704,8 +704,8 @@ def educateDashesOldSchool(text):
|
||||
an em-dash HTML entity.
|
||||
'''
|
||||
|
||||
text = re.sub(r'''---''', r'''—''', text) # em (yes, backwards)
|
||||
text = re.sub(r'''--''', r'''–''', text) # en (yes, backwards)
|
||||
text = text.replace('---', '—') # em (yes, backwards)
|
||||
text = text.replace('--', '–') # en (yes, backwards)
|
||||
return text
|
||||
|
||||
|
||||
@ -724,8 +724,8 @@ def educateDashesOldSchoolInverted(text):
|
||||
the shortcut should be shorter to type. (Thanks to Aaron
|
||||
Swartz for the idea.)
|
||||
'''
|
||||
text = re.sub(r'''---''', r'''–''', text) # em
|
||||
text = re.sub(r'''--''', r'''—''', text) # en
|
||||
text = text.replace('---', '–') # em
|
||||
text = text.replace('--', '—') # en
|
||||
return text
|
||||
|
||||
|
||||
@ -739,8 +739,8 @@ def educateEllipses(text):
|
||||
Example output: Huh…?
|
||||
'''
|
||||
|
||||
text = re.sub(r'''\.\.\.''', r'''…''', text)
|
||||
text = re.sub(r'''\. \. \.''', r'''…''', text)
|
||||
text = text.replace('...', '…')
|
||||
text = text.replace('. . .', '…')
|
||||
return text
|
||||
|
||||
|
||||
@ -754,16 +754,16 @@ def stupefyEntities(text):
|
||||
Example output: "Hello -- world."
|
||||
'''
|
||||
|
||||
text = re.sub(r'''–''', r'''-''', text) # en-dash
|
||||
text = re.sub(r'''—''', r'''--''', text) # em-dash
|
||||
text = text.replace('–', '-') # en-dash
|
||||
text = text.replace('—', '--') # em-dash
|
||||
|
||||
text = re.sub(r'''‘''', r"""'""", text) # open single quote
|
||||
text = re.sub(r'''’''', r"""'""", text) # close single quote
|
||||
text = text.replace('‘', "'") # open single quote
|
||||
text = text.replace('’', "'") # close single quote
|
||||
|
||||
text = re.sub(r'''“''', r'''"''', text) # open double quote
|
||||
text = re.sub(r'''”''', r'''"''', text) # close double quote
|
||||
text = text.replace('“', '"') # open double quote
|
||||
text = text.replace('”', '"') # close double quote
|
||||
|
||||
text = re.sub(r'''…''', r'''...''', text) # ellipsis
|
||||
text = text.replace('…', '...') # ellipsis
|
||||
|
||||
return text
|
||||
|
||||
@ -784,12 +784,12 @@ def processEscapes(text):
|
||||
\- -
|
||||
\` `
|
||||
'''
|
||||
text = re.sub(r'''\\\\''', r'''\''', text)
|
||||
text = re.sub(r'''\\"''', r'''"''', text)
|
||||
text = re.sub(r"""\\'""", r''''''', text)
|
||||
text = re.sub(r'''\\\.''', r'''.''', text)
|
||||
text = re.sub(r'''\\-''', r'''-''', text)
|
||||
text = re.sub(r'''\\`''', r'''`''', text)
|
||||
text = text.replace(r'\\', '\')
|
||||
text = text.replace(r'\"', '"')
|
||||
text = text.replace(r"\'", ''')
|
||||
text = text.replace(r'\.', '.')
|
||||
text = text.replace(r'\-', '-')
|
||||
text = text.replace(r'\`', '`')
|
||||
|
||||
return text
|
||||
|
||||
|
@ -645,7 +645,7 @@ class BasicNewsRecipe(Recipe):
|
||||
`soup`: A `BeautifulSoup <https://www.crummy.com/software/BeautifulSoup/bs4/doc/>`__
|
||||
instance containing the downloaded :term:`HTML`.
|
||||
'''
|
||||
return None
|
||||
return
|
||||
|
||||
def abort_article(self, msg=None):
|
||||
''' Call this method inside any of the preprocess methods to abort the
|
||||
|
Loading…
x
Reference in New Issue
Block a user