mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
code indentation (extra-edit)
This commit is contained in:
parent
8032201318
commit
0b23eaf328
@ -40,8 +40,7 @@ class AdvancedUserRecipe1294946868(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
|
|
||||||
remove_tags_before = dict(name='ul', attrs={'class': ['servicios-sub']})
|
remove_tags_before = dict(name='ul', attrs={'class': ['servicios-sub']})
|
||||||
remove_tags_after = dict(
|
remove_tags_after = dict(name='div', attrs={'class': ['related-news', 'col']})
|
||||||
name='div', attrs={'class': ['related-news', 'col']})
|
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name='ol', attrs={'class': ['navigation', ]}), dict(name='span', attrs={'class': ['action']}), dict(name='div', attrs={'class': ['twitter comments-list hidden', 'related-news', 'col', 'photo-gallery', 'photo-gallery side-art-block', 'calendario', 'article-comment', 'postto estirar', 'otras_vinetas estirar', 'kment', 'user-actions']}), dict( name='div', attrs={'id': ['twitter-destacados', 'eco-tabs', 'inner', 'vineta_calendario', 'vinetistas clearfix', 'otras_vinetas estirar', 'MIN1', 'main', 'SUP1', 'INT']}), dict(name='ul', attrs={'class': ['article-user-actions', 'stripped-list']}), dict(name='ul', attrs={'id': ['site-links']}), dict(name='li', attrs={'class': ['puntuacion', 'enviar', 'compartir']}) # noqa: E501
|
dict(name='ol', attrs={'class': ['navigation', ]}), dict(name='span', attrs={'class': ['action']}), dict(name='div', attrs={'class': ['twitter comments-list hidden', 'related-news', 'col', 'photo-gallery', 'photo-gallery side-art-block', 'calendario', 'article-comment', 'postto estirar', 'otras_vinetas estirar', 'kment', 'user-actions']}), dict( name='div', attrs={'id': ['twitter-destacados', 'eco-tabs', 'inner', 'vineta_calendario', 'vinetistas clearfix', 'otras_vinetas estirar', 'MIN1', 'main', 'SUP1', 'INT']}), dict(name='ul', attrs={'class': ['article-user-actions', 'stripped-list']}), dict(name='ul', attrs={'id': ['site-links']}), dict(name='li', attrs={'class': ['puntuacion', 'enviar', 'compartir']}) # noqa: E501
|
||||||
|
@ -9,8 +9,7 @@ from calibre.web.feeds.recipes import BasicNewsRecipe
|
|||||||
|
|
||||||
def classes(classes):
|
def classes(classes):
|
||||||
q = frozenset(classes.split(' '))
|
q = frozenset(classes.split(' '))
|
||||||
return dict(attrs={
|
return dict(attrs={'class': lambda x: x and frozenset(x.split()).intersection(q)})
|
||||||
'class': lambda x: x and frozenset(x.split()).intersection(q)})
|
|
||||||
|
|
||||||
|
|
||||||
class Minutes(BasicNewsRecipe):
|
class Minutes(BasicNewsRecipe):
|
||||||
|
@ -199,8 +199,7 @@ def download(dest_dir, manifest_version=17, manifest_type='release', manifest_pa
|
|||||||
pkgs = Packages(manifest, crt_variant, arch)
|
pkgs = Packages(manifest, crt_variant, arch)
|
||||||
os.makedirs(dest_dir, exist_ok=True)
|
os.makedirs(dest_dir, exist_ok=True)
|
||||||
total = sum(x.size for x in pkgs.files_to_download)
|
total = sum(x.size for x in pkgs.files_to_download)
|
||||||
print('Downloading', int(total/(1024*1024)), 'MB in', len(pkgs.files_to_download),
|
print('Downloading', int(total/(1024*1024)), 'MB in', len(pkgs.files_to_download), 'files...')
|
||||||
'files...')
|
|
||||||
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
|
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
|
||||||
for _ in executor.map(partial(download_item, dest_dir), pkgs.files_to_download):
|
for _ in executor.map(partial(download_item, dest_dir), pkgs.files_to_download):
|
||||||
pass
|
pass
|
||||||
|
@ -126,12 +126,12 @@ class JETBOOK_MINI(USBMS):
|
|||||||
|
|
||||||
class JETBOOK_COLOR(USBMS):
|
class JETBOOK_COLOR(USBMS):
|
||||||
'''
|
'''
|
||||||
set([('0x951',
|
set(['0x951',
|
||||||
'0x160b',
|
'0x160b',
|
||||||
'0x0',
|
'0x0',
|
||||||
'Freescale',
|
'Freescale',
|
||||||
'Mass Storage Device',
|
'Mass Storage Device',
|
||||||
'0802270905553')])
|
'0802270905553'])
|
||||||
'''
|
'''
|
||||||
|
|
||||||
FORMATS = ['epub', 'mobi', 'prc', 'fb2', 'rtf', 'txt', 'pdf', 'djvu']
|
FORMATS = ['epub', 'mobi', 'prc', 'fb2', 'rtf', 'txt', 'pdf', 'djvu']
|
||||||
|
@ -94,7 +94,7 @@ NAME_MAP = {
|
|||||||
'springgreen': '#00FF7F',
|
'springgreen': '#00FF7F',
|
||||||
'violet': '#EE82EE',
|
'violet': '#EE82EE',
|
||||||
'yellowgreen': '#9ACD32'
|
'yellowgreen': '#9ACD32'
|
||||||
}
|
}
|
||||||
|
|
||||||
hex_pat = re.compile(r'#(\d{2})(\d{2})(\d{2})')
|
hex_pat = re.compile(r'#(\d{2})(\d{2})(\d{2})')
|
||||||
rgb_pat = re.compile(r'rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)', re.IGNORECASE)
|
rgb_pat = re.compile(r'rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)', re.IGNORECASE)
|
||||||
|
@ -1793,4 +1793,4 @@ CODEPOINTS = {
|
|||||||
'7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2',
|
'7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2',
|
||||||
'3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9'
|
'3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -359,14 +359,14 @@ special_styles = {
|
|||||||
'P-Heading_20_4':'h4',
|
'P-Heading_20_4':'h4',
|
||||||
'P-Heading_20_5':'h5',
|
'P-Heading_20_5':'h5',
|
||||||
'P-Heading_20_6':'h6',
|
'P-Heading_20_6':'h6',
|
||||||
# 'P-Caption':'caption',
|
# 'P-Caption':'caption',
|
||||||
'P-Addressee':'address',
|
'P-Addressee':'address',
|
||||||
# 'P-List_20_Heading':'dt',
|
# 'P-List_20_Heading':'dt',
|
||||||
# 'P-List_20_Contents':'dd',
|
# 'P-List_20_Contents':'dd',
|
||||||
'P-Preformatted_20_Text':'pre',
|
'P-Preformatted_20_Text':'pre',
|
||||||
# 'P-Table_20_Heading':'th',
|
# 'P-Table_20_Heading':'th',
|
||||||
# 'P-Table_20_Contents':'td',
|
# 'P-Table_20_Contents':'td',
|
||||||
# 'P-Text_20_body':'p'
|
# 'P-Text_20_body':'p'
|
||||||
}
|
}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user