mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
pep8
This commit is contained in:
parent
5205cc97b0
commit
253012d392
@ -23,6 +23,37 @@
|
|||||||
# - title by author
|
# - title by author
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
{{{ 7.10.0 2024-05-03
|
||||||
|
|
||||||
|
:: new features
|
||||||
|
|
||||||
|
- Export of calibre data: Ensure individual part files in the exported data are no larger than one gigabyte even
|
||||||
|
if the library contains individual files larger than that size.
|
||||||
|
|
||||||
|
Note that this means that exports created by calibre from this version
|
||||||
|
on will not be importable by earlier versions. However, exports from
|
||||||
|
earlier versions should still be importable.
|
||||||
|
|
||||||
|
- Edit book: Spell check: Add options to exclude words in ALL CAPS or with numbers or in camelCase/snake_case from the list of words
|
||||||
|
|
||||||
|
- Allow easily inverting the current search via the right click menu on the search box
|
||||||
|
|
||||||
|
:: bug fixes
|
||||||
|
|
||||||
|
- [2064546] Kobo driver: Fix database unsupported error with newest firmware
|
||||||
|
|
||||||
|
- [2063301] DOCX Input: Fix text elements containing only whitespace being incorrectly ignored
|
||||||
|
|
||||||
|
- Bulk metadata dialog: Do not fail when setting covers from ebook files and some of the files have invalid covers
|
||||||
|
|
||||||
|
:: improved recipes
|
||||||
|
- Economist
|
||||||
|
- The Week
|
||||||
|
- Caravan Magazine
|
||||||
|
- Financial Times
|
||||||
|
|
||||||
|
}}}
|
||||||
|
|
||||||
{{{ 7.9.0 2024-04-19
|
{{{ 7.9.0 2024-04-19
|
||||||
|
|
||||||
:: new features
|
:: new features
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import json
|
import json
|
||||||
from urllib.parse import urlparse, quote
|
from urllib.parse import quote, urlparse
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
from mechanize import Request
|
from mechanize import Request
|
||||||
|
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ class CaravanMagazine(BasicNewsRecipe):
|
|||||||
art_id = cache_data['result']['data']['json']['articleId']
|
art_id = cache_data['result']['data']['json']['articleId']
|
||||||
prim_data = cache_data['result']['data']['json']['data']
|
prim_data = cache_data['result']['data']['json']['data']
|
||||||
|
|
||||||
cat = subhead = desc = lede = auth = ''
|
cat = desc = lede = auth = ''
|
||||||
|
|
||||||
cat = '<div class="cat">' + safe_dict(prim_data, 'printTitle') + '</div>\n'
|
cat = '<div class="cat">' + safe_dict(prim_data, 'printTitle') + '</div>\n'
|
||||||
title = '<h1>' + safe_dict(prim_data, 'title') + '</h1>\n'
|
title = '<h1>' + safe_dict(prim_data, 'title') + '</h1>\n'
|
||||||
@ -179,8 +179,8 @@ class CaravanMagazine(BasicNewsRecipe):
|
|||||||
authors.append(safe_dict(q, 'name'))
|
authors.append(safe_dict(q, 'name'))
|
||||||
dt = ''
|
dt = ''
|
||||||
if prim_data.get('writtenAt', '') != '':
|
if prim_data.get('writtenAt', '') != '':
|
||||||
from datetime import datetime, timedelta
|
|
||||||
import time
|
import time
|
||||||
|
from datetime import datetime, timedelta
|
||||||
dt = datetime.fromisoformat(prim_data['writtenAt'][:-1]) + timedelta(seconds=time.timezone)
|
dt = datetime.fromisoformat(prim_data['writtenAt'][:-1]) + timedelta(seconds=time.timezone)
|
||||||
dt = dt.strftime('%b %d, %Y, %I:%M %p')
|
dt = dt.strftime('%b %d, %Y, %I:%M %p')
|
||||||
auth ='<p class="auth">' + ', '.join(authors) + ' | ' + dt + '</p>\n'
|
auth ='<p class="auth">' + ', '.join(authors) + ' | ' + dt + '</p>\n'
|
||||||
|
@ -44,15 +44,18 @@ class Volkskrant(BasicNewsRecipe):
|
|||||||
url = self.home_url + url
|
url = self.home_url + url
|
||||||
title_parts = []
|
title_parts = []
|
||||||
tag = article.find('div', {'class': 'abstract-article__tag'})
|
tag = article.find('div', {'class': 'abstract-article__tag'})
|
||||||
if tag: title_parts.append(self.tag_to_string(tag).upper())
|
if tag:
|
||||||
|
title_parts.append(self.tag_to_string(tag).upper())
|
||||||
title_parts.append(self.tag_to_string(article.find('div', {'class': 'abstract-article__title'})))
|
title_parts.append(self.tag_to_string(article.find('div', {'class': 'abstract-article__title'})))
|
||||||
article_title = ' \u2022 '.join(title_parts)
|
article_title = ' \u2022 '.join(title_parts)
|
||||||
pubdate=''
|
pubdate=''
|
||||||
description_parts = []
|
description_parts = []
|
||||||
author = article.find('div', {'class': 'abstract-article__author'})
|
author = article.find('div', {'class': 'abstract-article__author'})
|
||||||
if author: description_parts.append(self.tag_to_string(author))
|
if author:
|
||||||
|
description_parts.append(self.tag_to_string(author))
|
||||||
summary = article.find('div', {'class': 'abstract-article__content'})
|
summary = article.find('div', {'class': 'abstract-article__content'})
|
||||||
if summary: description_parts.append(self.tag_to_string(summary))
|
if summary:
|
||||||
|
description_parts.append(self.tag_to_string(summary))
|
||||||
description = ' \u2022 '.join(description_parts)
|
description = ' \u2022 '.join(description_parts)
|
||||||
return dict(
|
return dict(
|
||||||
title=article_title,
|
title=article_title,
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
|
||||||
import uuid
|
|
||||||
from mechanize import Request
|
|
||||||
from contextlib import closing
|
|
||||||
import json
|
import json
|
||||||
|
import uuid
|
||||||
|
from contextlib import closing
|
||||||
|
|
||||||
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
|
from mechanize import Request
|
||||||
|
|
||||||
|
|
||||||
class Parool(BasicNewsRecipe):
|
class Parool(BasicNewsRecipe):
|
||||||
title = 'Het Parool'
|
title = 'Het Parool'
|
||||||
@ -18,7 +20,8 @@ class Parool(BasicNewsRecipe):
|
|||||||
remove_tags_before = dict(id='main-content')
|
remove_tags_before = dict(id='main-content')
|
||||||
remove_tags_after = dict(id='main-content')
|
remove_tags_after = dict(id='main-content')
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(attrs={'class':['article-footer__sharing', 'artstyle__editorial-tips', 'artstyle__advertisement','artstyle__container__icon','artstyle__disabled-embed','container__title__icon',]}),
|
dict(attrs={'class':['article-footer__sharing', 'artstyle__editorial-tips', 'artstyle__advertisement',
|
||||||
|
'artstyle__container__icon','artstyle__disabled-embed','container__title__icon',]}),
|
||||||
dict(attrs={'data-element-id': ['article-element-authors']}),
|
dict(attrs={'data-element-id': ['article-element-authors']}),
|
||||||
dict(name=['script', 'noscript', 'style']),
|
dict(name=['script', 'noscript', 'style']),
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
|
|
||||||
|
|
||||||
class Volkskrant(BasicNewsRecipe):
|
class Volkskrant(BasicNewsRecipe):
|
||||||
title = 'Revista 22'
|
title = 'Revista 22'
|
||||||
__author__ = 'Cristi Ghera'
|
__author__ = 'Cristi Ghera'
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
|
||||||
import uuid
|
|
||||||
from mechanize import Request
|
|
||||||
from contextlib import closing
|
|
||||||
import json
|
import json
|
||||||
|
import uuid
|
||||||
|
from contextlib import closing
|
||||||
|
|
||||||
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
|
from mechanize import Request
|
||||||
|
|
||||||
|
|
||||||
class Volkskrant(BasicNewsRecipe):
|
class Volkskrant(BasicNewsRecipe):
|
||||||
title = 'Volkskrant'
|
title = 'Volkskrant'
|
||||||
|
@ -11,7 +11,7 @@ from functools import lru_cache
|
|||||||
from polyglot.builtins import environ_item, hasenv
|
from polyglot.builtins import environ_item, hasenv
|
||||||
|
|
||||||
__appname__ = 'calibre'
|
__appname__ = 'calibre'
|
||||||
numeric_version = (7, 9, 100)
|
numeric_version = (7, 10, 0)
|
||||||
__version__ = '.'.join(map(str, numeric_version))
|
__version__ = '.'.join(map(str, numeric_version))
|
||||||
git_version = None
|
git_version = None
|
||||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user