diff --git a/recipes/1843.recipe b/recipes/1843.recipe index 252f36d1c6..d7c79c7122 100644 --- a/recipes/1843.recipe +++ b/recipes/1843.recipe @@ -358,9 +358,9 @@ class Economist(BasicNewsRecipe): cleanup_html_article(root) if '/interactive/' in url: - return '

' + root.xpath('//h1')[0].text + '

' \ - + 'This article is supposed to be read in a browser' \ - + '
' + return ('

' + root.xpath('//h1')[0].text + '

' + 'This article is supposed to be read in a browser.' + '
') for div in root.xpath('//div[@class="lazy-image"]'): noscript = list(div.iter('noscript')) diff --git a/recipes/ad.recipe b/recipes/ad.recipe index a8f69b107d..1164c480a5 100644 --- a/recipes/ad.recipe +++ b/recipes/ad.recipe @@ -85,9 +85,10 @@ class ADRecipe(BasicNewsRecipe): def print_version(self, url): parts = url.split('/') - print_url = 'http://' + parts[2] + '/' + parts[3] + '/' + parts[4] + '/' + parts[5] + '/' \ - + parts[10] + '/' + parts[7] + '/print/' + \ - parts[8] + '/' + parts[9] + '/' + parts[13] + print_url = 'http://' + '/'.join([ + parts[2], parts[3], parts[4], parts[5], parts[10], + parts[7], 'print', parts[8], parts[9], parts[13], + ]) return print_url diff --git a/recipes/al_monitor.recipe b/recipes/al_monitor.recipe index e9fad7b272..d57e602275 100644 --- a/recipes/al_monitor.recipe +++ b/recipes/al_monitor.recipe @@ -203,11 +203,10 @@ class AlMonitor(BasicNewsRecipe): return self.tag_to_string(n).strip() def _dbg_soup_node(self, node): - s = ' cls: ' + str(node.get('class')).strip() + \ - ' id: ' + str(node.get('id')).strip() + \ - ' role: ' + str(node.get('role')).strip() + \ - ' txt: ' + self.text(node) - return s + return (' cls: ' + str(node.get('class')).strip() + + ' id: ' + str(node.get('id')).strip() + + ' role: ' + str(node.get('role')).strip() + + ' txt: ' + self.text(node)) def _p(self, msg): curframe = inspect.currentframe() diff --git a/recipes/billorielly.recipe b/recipes/billorielly.recipe index 4223df0093..bb87260362 100644 --- a/recipes/billorielly.recipe +++ b/recipes/billorielly.recipe @@ -49,8 +49,7 @@ class BillOReilly(BasicNewsRecipe): continue if url.startswith('/'): - url = 'http://www.billoreilly.com' + url + \ - '&dest=/pg/jsp/community/tvshowprint.jsp' + url = 'http://www.billoreilly.com' + url + '&dest=/pg/jsp/community/tvshowprint.jsp' self.log('\t\tFound article:', title) self.log('\t\t\t', url) diff --git a/recipes/brewiarz.recipe b/recipes/brewiarz.recipe index d666d4835a..0eb5cf0542 100644 --- a/recipes/brewiarz.recipe +++ b/recipes/brewiarz.recipe @@ -41,21 +41,20 @@ class brewiarz(BasicNewsRecipe): url_date_weekday = url_date.strftime('%A') url_date_weekday_pl = weekday_dict[url_date_weekday] - url = 'http://brewiarz.pl/' + url_date_month_roman + '_' + \ - url_date_year + '/' + url_date_day + url_date_month + '/index.php3' + url = ('http://brewiarz.pl/' + url_date_month_roman + '_' + + url_date_year + '/' + url_date_day + url_date_month + '/index.php3') articles = self.parse_pages(url) if articles: - title = url_date_weekday_pl + ' ' + url_date_day + \ - '.' + url_date_month + '.' + url_date_year + title = (url_date_weekday_pl + ' ' + url_date_day + + '.' + url_date_month + '.' + url_date_year) feeds.append((title, articles)) else: sectors = self.get_sectors(url) for subpage in sectors: - title = url_date_weekday_pl + ' ' + url_date_day + '.' + \ - url_date_month + '.' + url_date_year + ' - ' + subpage.string - url = 'http://brewiarz.pl/' + url_date_month_roman + '_' + url_date_year + \ - '/' + url_date_day + url_date_month + \ - '/' + subpage['href'] + title = (url_date_weekday_pl + ' ' + url_date_day + '.' + + url_date_month + '.' + url_date_year + ' - ' + subpage.string) + url = ('http://brewiarz.pl/' + url_date_month_roman + '_' + url_date_year + + '/' + url_date_day + url_date_month + '/' + subpage['href']) print(url) articles = self.parse_pages(url) if articles: diff --git a/recipes/calgary_herald.recipe b/recipes/calgary_herald.recipe index b9e3f145ba..eef67df749 100644 --- a/recipes/calgary_herald.recipe +++ b/recipes/calgary_herald.recipe @@ -154,8 +154,7 @@ class CanWestPaper(BasicNewsRecipe): except: while daysback < 7: cover = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg' + \ - str((date.today() - timedelta(days=daysback)).day) + \ - '/lg/' + self.fp_tag + '.jpg' + str((date.today() - timedelta(days=daysback)).day) + '/lg/' + self.fp_tag + '.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/caravan_magazine.recipe b/recipes/caravan_magazine.recipe index 6f276c5090..938fc7b393 100644 --- a/recipes/caravan_magazine.recipe +++ b/recipes/caravan_magazine.recipe @@ -213,6 +213,6 @@ class CaravanMagazine(BasicNewsRecipe): for x in art_cont['premiumContent']: premium_cont += '\n' + ''.join(parse_body(x)) - return '
' \ - + cat + title + desc + auth + lede + free_cont + premium_cont + \ - '
' + return ('
' + + cat + title + desc + auth + lede + free_cont + premium_cont + + '
') diff --git a/recipes/cato.recipe b/recipes/cato.recipe index c1a22df772..234ad3edba 100644 --- a/recipes/cato.recipe +++ b/recipes/cato.recipe @@ -5,9 +5,9 @@ from calibre.web.feeds.news import BasicNewsRecipe class CATOInstitute(BasicNewsRecipe): title = u'The CATO Institute' - description = 'The Cato Institute is a public policy research organization — a think tank — \ -dedicated to the principles of individual liberty, limited government, free markets and peace.\ - Its scholars and analysts conduct independent, nonpartisan research on a wide range of policy issues.' + description = ('The Cato Institute is a public policy research organization — a think tank — ' + 'dedicated to the principles of individual liberty, limited government, free markets and peace. ' + 'Its scholars and analysts conduct independent, nonpartisan research on a wide range of policy issues.') __author__ = '_reader' __date__ = '05 July 2012' __version__ = '1.0' diff --git a/recipes/courrierinternational.recipe b/recipes/courrierinternational.recipe index 891901ead0..043952ceaa 100644 --- a/recipes/courrierinternational.recipe +++ b/recipes/courrierinternational.recipe @@ -2,8 +2,8 @@ # vim:fileencoding=utf-8 __license__ = 'GPL v3' -__copyright__ = '2009, Mathieu Godlewski \ -2015, Rémi Vanicat , ' + '2015, Rémi Vanicat

' + root.xpath('//h1')[0].text + '

' \ - + 'This article is supposed to be read in a browser' \ - + '
' + return ('

' + root.xpath('//h1')[0].text + '

' + 'This article is supposed to be read in a browser.' + '
') for div in root.xpath('//div[@class="lazy-image"]'): noscript = list(div.iter('noscript')) @@ -555,12 +555,9 @@ class Economist(BasicNewsRecipe): # open('/t/raw.html', 'wb').write(raw.encode('utf-8')) root_ = parse(raw) if '/interactive/' in url: - return ( - '

' - + root_.xpath('//h1')[0].text + '

' - + 'This article is supposed to be read in a browser' - + '
' - ) + return ('

' + root_.xpath('//h1')[0].text + '

' + 'This article is supposed to be read in a browser' + '
') script = root_.xpath('//script[@id="__NEXT_DATA__"]') diff --git a/recipes/economist_free.recipe b/recipes/economist_free.recipe index e513af729a..883a7e4c5d 100644 --- a/recipes/economist_free.recipe +++ b/recipes/economist_free.recipe @@ -409,9 +409,9 @@ class Economist(BasicNewsRecipe): load_article_from_json(raw, root) if '/interactive/' in url: - return '

' + root.xpath('//h1')[0].text + '

' \ - + 'This article is supposed to be read in a browser' \ - + '
' + return ('

' + root.xpath('//h1')[0].text + '

' + 'This article is supposed to be read in a browser.' + '
') for div in root.xpath('//div[@class="lazy-image"]'): noscript = list(div.iter('noscript')) @@ -555,12 +555,9 @@ class Economist(BasicNewsRecipe): # open('/t/raw.html', 'wb').write(raw.encode('utf-8')) root_ = parse(raw) if '/interactive/' in url: - return ( - '

' - + root_.xpath('//h1')[0].text + '

' - + 'This article is supposed to be read in a browser' - + '
' - ) + return ('

' + root_.xpath('//h1')[0].text + '

' + 'This article is supposed to be read in a browser' + '
') script = root_.xpath('//script[@id="__NEXT_DATA__"]') diff --git a/recipes/economist_news.recipe b/recipes/economist_news.recipe index a95445403f..e08f7ba91d 100644 --- a/recipes/economist_news.recipe +++ b/recipes/economist_news.recipe @@ -276,9 +276,9 @@ class EconomistNews(BasicNewsRecipe): load_article_from_json(raw, root) if '/interactive/' in url: - return '

' + root.xpath('//h1')[0].text + '

' \ - + 'This article is supposed to be read in a browser' \ - + '
' + return ('

' + root.xpath('//h1')[0].text + '

' + 'This article is supposed to be read in a browser.' + '
') for div in root.xpath('//div[@class="lazy-image"]'): noscript = list(div.iter('noscript')) diff --git a/recipes/economist_search.recipe b/recipes/economist_search.recipe index b8ad8dfb97..5ac61ad57f 100644 --- a/recipes/economist_search.recipe +++ b/recipes/economist_search.recipe @@ -169,12 +169,9 @@ class econ_search(BasicNewsRecipe): # open('/t/raw.html', 'wb').write(raw.encode('utf-8')) root_ = parse(raw) if '/interactive/' in url: - return ( - '

' - + root_.xpath('//h1')[0].text + '

' - + 'This article is supposed to be read in a browser' - + '
' - ) + return ('

' + root_.xpath('//h1')[0].text + '

' + 'This article is supposed to be read in a browser.' + '
') script = root_.xpath('//script[@id="__NEXT_DATA__"]') diff --git a/recipes/economist_world_ahead.recipe b/recipes/economist_world_ahead.recipe index 8b2bd6d3fe..6d7e2336ee 100644 --- a/recipes/economist_world_ahead.recipe +++ b/recipes/economist_world_ahead.recipe @@ -245,12 +245,9 @@ class EconomistWorld(BasicNewsRecipe): # open('/t/raw.html', 'wb').write(raw.encode('utf-8')) root_ = parse(raw) if '/interactive/' in url: - return ( - '

' - + root_.xpath('//h1')[0].text + '

' - + 'This article is supposed to be read in a browser' - + '
' - ) + return ('

' + root_.xpath('//h1')[0].text + '

' + 'This article is supposed to be read in a browser.' + '
') script = root_.xpath('//script[@id="__NEXT_DATA__"]') diff --git a/recipes/edmonton_journal.recipe b/recipes/edmonton_journal.recipe index a8daaaaecc..f6a054a5e0 100644 --- a/recipes/edmonton_journal.recipe +++ b/recipes/edmonton_journal.recipe @@ -154,8 +154,7 @@ class CanWestPaper(BasicNewsRecipe): except: while daysback < 7: cover = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg' + \ - str((date.today() - timedelta(days=daysback)).day) + \ - '/lg/' + self.fp_tag + '.jpg' + str((date.today() - timedelta(days=daysback)).day) + '/lg/' + self.fp_tag + '.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/elmundo.recipe b/recipes/elmundo.recipe index c4ed15ce6a..21c7f832b0 100644 --- a/recipes/elmundo.recipe +++ b/recipes/elmundo.recipe @@ -85,8 +85,7 @@ class ElMundo(BasicNewsRecipe): year = str(st.tm_year) month = '%.2d' % st.tm_mon day = '%.2d' % st.tm_mday - cover = 'http://img.kiosko.net/' + year + '/' + \ - month + '/' + day + '/es/elmundo.750.jpg' + cover = 'http://img.kiosko.net/' + '/'.join([year, month, day]) + '/es/elmundo.750.jpg' try: self.browser.open(cover) except: diff --git a/recipes/elperiodico_spanish.recipe b/recipes/elperiodico_spanish.recipe index 8aab5a542f..4aa07b9524 100644 --- a/recipes/elperiodico_spanish.recipe +++ b/recipes/elperiodico_spanish.recipe @@ -36,8 +36,8 @@ class ElPeriodico_cat(BasicNewsRecipe): '--comment', description, '--category', category, '--publisher', publisher ] - html2epub_options = 'publisher="' + publisher + \ - '"\ncomments="' + description + '"\ntags="' + category + '"' + html2epub_options = ('publisher="' + publisher + + '"\ncomments="' + description + '"\ntags="' + category + '"') feeds = [(u'Portada', u'http://www.elperiodico.com/es/rss/rss_portada.xml'), (u'Internacional', u'http://elperiodico.com/es/rss/internacional/rss.xml'), diff --git a/recipes/esenja.recipe b/recipes/esenja.recipe index 5f88fe7604..5836913ab4 100644 --- a/recipes/esenja.recipe +++ b/recipes/esenja.recipe @@ -53,8 +53,7 @@ class Esensja(BasicNewsRecipe): month = a['href'].split('/')[1] self.HREF = 'http://www.esensja.pl/magazyn/' + year + '/' + month + '/iso/' soup = self.index_to_soup(self.HREF + '01.html') - self.cover_url = 'http://www.esensja.pl/magazyn/' + \ - year + '/' + month + '/img/ilustr/cover_b.jpg' + self.cover_url = 'http://www.esensja.pl/magazyn/' + year + '/' + month + '/img/ilustr/cover_b.jpg' feeds = [] chapter = '' subchapter = '' diff --git a/recipes/esensja_(rss).recipe b/recipes/esensja_(rss).recipe index 55630cf6a7..1e301e4822 100644 --- a/recipes/esensja_(rss).recipe +++ b/recipes/esensja_(rss).recipe @@ -51,9 +51,9 @@ class EsensjaRSS(BasicNewsRecipe): def get_cover_url(self): soup = self.index_to_soup(self.INDEX) cover = soup.find(id='panel_1') - self.cover_url = self.INDEX + \ - cover.find('a')['href'].replace( - 'index.html', '') + 'img/ilustr/cover_b.jpg' + self.cover_url = (self.INDEX + + cover.find('a')['href'].replace('index.html', '') + + 'img/ilustr/cover_b.jpg') return getattr(self, 'cover_url', self.cover_url) def append_page(self, soup, appendtag): diff --git a/recipes/expansion_spanish.recipe b/recipes/expansion_spanish.recipe index 61f35e2241..bc72f2637f 100644 --- a/recipes/expansion_spanish.recipe +++ b/recipes/expansion_spanish.recipe @@ -108,8 +108,7 @@ class expansion_spanish(BasicNewsRecipe): year = str(st.tm_year) month = '%.2d' % st.tm_mon day = '%.2d' % st.tm_mday - cover = 'http://img5.kiosko.net/' + year + '/' + \ - month + '/' + day + '/es/expansion.750.jpg' + cover = 'http://img5.kiosko.net/' + '/'.join([year, month, day]) + '/es/expansion.750.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/gosc_full.recipe b/recipes/gosc_full.recipe index d2657b0ae2..8e373f95f4 100644 --- a/recipes/gosc_full.recipe +++ b/recipes/gosc_full.recipe @@ -2,8 +2,8 @@ from __future__ import unicode_literals __license__ = 'GPL v3' -__copyright__ = '2011, Piotr Kontek, piotr.kontek@gmail.com \ - 2013-2018, Tomasz Długosz, tomek3d@gmail.com' +__copyright__ = ('2011, Piotr Kontek, piotr.kontek@gmail.com ' + '2013-2018, Tomasz Długosz, tomek3d@gmail.com') import re import time diff --git a/recipes/gosc_niedzielny.recipe b/recipes/gosc_niedzielny.recipe index 69a63f59f6..fc26fb911f 100644 --- a/recipes/gosc_niedzielny.recipe +++ b/recipes/gosc_niedzielny.recipe @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- __license__ = 'GPL v3' -__copyright__ = '2011, Piotr Kontek, piotr.kontek@gmail.com \ - 2013-2018, Tomasz Długosz, tomek3d@gmail.com' +__copyright__ = ('2011, Piotr Kontek, piotr.kontek@gmail.com ' + '2013-2018, Tomasz Długosz, tomek3d@gmail.com') import re diff --git a/recipes/gry_online_pl.recipe b/recipes/gry_online_pl.recipe index 61fd76d1c0..d9a8771873 100644 --- a/recipes/gry_online_pl.recipe +++ b/recipes/gry_online_pl.recipe @@ -33,8 +33,7 @@ class GryOnlinePl(BasicNewsRecipe): url_part = soup.find('link', attrs={'rel': 'canonical'})['href'] url_part = url_part[25:].rpartition('?')[0] for nexturl in nexturls[1:-1]: - finalurl = 'http://www.gry-online.pl/' + \ - url_part + nexturl['href'] + finalurl = 'http://www.gry-online.pl/' + url_part + nexturl['href'] for i in range(10): try: soup2 = self.index_to_soup(finalurl) @@ -69,8 +68,7 @@ class GryOnlinePl(BasicNewsRecipe): break else: nexturl = tag.a - finalurl = 'http://www.gry-online.pl/' + \ - url_part + nexturl['href'] + finalurl = 'http://www.gry-online.pl/' + url_part + nexturl['href'] for i in range(10): try: soup2 = self.index_to_soup(finalurl) diff --git a/recipes/hackernews.recipe b/recipes/hackernews.recipe index 6efaa787d5..3d9656c158 100644 --- a/recipes/hackernews.recipe +++ b/recipes/hackernews.recipe @@ -71,9 +71,7 @@ class HNWithCommentsLink(BasicNewsRecipe): for td in main.findAll('td', 'default'): comhead = td.find('span', 'comhead') if comhead: - com_title = u'

' + \ - self.tag_to_string(comhead).replace( - ' | link', '') + u'

' + com_title = u'

' + self.tag_to_string(comhead).replace(' | link', '') + u'

' comhead.parent.extract() br = td.find('br') if br: @@ -86,8 +84,8 @@ class HNWithCommentsLink(BasicNewsRecipe): td['style'] = 'padding-left: ' + str(indent_width) + 'px' comments = comments + com_title + td.prettify() - body = u'

' + title + u'

' + readable_link + \ - u'
' + subtext + u'

' + title_content + u'
' + body = (u'

' + title + u'

' + readable_link + + u'
' + subtext + u'

' + title_content + u'
') body = body + comments return u'' + title + u'' + body + '' @@ -114,8 +112,7 @@ class HNWithCommentsLink(BasicNewsRecipe): else: content = self.get_readable_content(url) - # content = re.sub(r'\s*\s*$', '', content) + \ - # article.summary + '' + # content = re.sub(r'\s*\s*$', '', content) + article.summary + '' if not isinstance(content, bytes): content = content.encode('utf-8') diff --git a/recipes/history_today.recipe b/recipes/history_today.recipe index 5c1677f9cd..43d55648b1 100644 --- a/recipes/history_today.recipe +++ b/recipes/history_today.recipe @@ -70,15 +70,12 @@ class HistoryToday(BasicNewsRecipe): if len(subarticle) < 2: continue title = self.tag_to_string(subarticle[0]) - originalurl = 'https://www.historytoday.com' + \ - subarticle[0].span.a['href'].strip() + originalurl = 'https://www.historytoday.com' + subarticle[0].span.a['href'].strip() originalpage = self.index_to_soup(originalurl) - printurl = originalpage.find( - 'div', attrs={'id': 'ht-tools'}).a['href'].strip() + printurl = originalpage.find('div', attrs={'id': 'ht-tools'}).a['href'].strip() url = 'https://www.historytoday.com' + printurl desc = self.tag_to_string(subarticle[1]) - articles.append({'title': title, 'url': url, - 'description': desc, 'date': ''}) + articles.append({'title': title, 'url': url,'description': desc, 'date': ''}) if articles: if section_title not in feeds: diff --git a/recipes/ifzm.recipe b/recipes/ifzm.recipe index 74fef36032..8cc96344f8 100644 --- a/recipes/ifzm.recipe +++ b/recipes/ifzm.recipe @@ -40,8 +40,8 @@ class infzm(BasicNewsRecipe): def get_obfuscated_article(self, url): br = self.get_browser() link = url - res_link = link.replace('https://www.infzm.com', 'https://api.infzm.com/mobile') \ - + '?platform=wap&version=1.89.0&machine_id=35458aa29603f2b246636e5492122b50&user_id=&token=&member_type=' + res_link = (link.replace('https://www.infzm.com', 'https://api.infzm.com/mobile') + + '?platform=wap&version=1.89.0&machine_id=35458aa29603f2b246636e5492122b50&user_id=&token=&member_type=') # if article is paywalled, add code to figure out machine_id raw = br.open(res_link).read() html = json_to_html(raw, link) diff --git a/recipes/il_messaggero.recipe b/recipes/il_messaggero.recipe index 7225877c54..26feeb0153 100644 --- a/recipes/il_messaggero.recipe +++ b/recipes/il_messaggero.recipe @@ -45,8 +45,7 @@ class IlMessaggero(BasicNewsRecipe): year = str(st.tm_year) month = '%.2d' % st.tm_mon day = '%.2d' % st.tm_mday - cover = 'http://carta.ilmessaggero.it/' + year + \ - month + day + '/jpeg/MSGR_20_CITTA_1.jpg' + cover = 'http://carta.ilmessaggero.it/' + year + month + day + '/jpeg/MSGR_20_CITTA_1.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/ilmanifesto.recipe b/recipes/ilmanifesto.recipe index 5f252204a1..5ae8ff772e 100644 --- a/recipes/ilmanifesto.recipe +++ b/recipes/ilmanifesto.recipe @@ -43,8 +43,7 @@ class IlManifesto(BasicNewsRecipe): def get_cover_url(self): self._set_manifesto_index() - url = MANIFESTO_BASEURL + \ - 'fileadmin/archivi/in_edicola/%sprimapagina.gif' % self.manifesto_datestr + url = MANIFESTO_BASEURL + 'fileadmin/archivi/in_edicola/%sprimapagina.gif' % self.manifesto_datestr return url def parse_index(self): diff --git a/recipes/independent.recipe b/recipes/independent.recipe index fe2e5c3c69..53d58b1298 100644 --- a/recipes/independent.recipe +++ b/recipes/independent.recipe @@ -22,11 +22,11 @@ class TheIndependentNew(BasicNewsRecipe): title = u'The Independent' __author__ = 'Krittika Goyal' - description = 'The latest in UK News and World News from The \ - Independent. Wide range of international and local news, sports \ - news, commentary and opinion pieces.Independent News - Breaking news \ - that matters. Your daily comprehensive news source - The \ - Independent Newspaper' + description = ('The latest in UK News and World News from The ' + 'Independent. Wide range of international and local news, sports ' + 'news, commentary and opinion pieces.Independent News - Breaking news ' + 'that matters. Your daily comprehensive news source - The ' + 'Independent Newspaper') publisher = 'The Independent' oldest_article = 2.0 ignore_duplicate_articles = {'title', 'url'} diff --git a/recipes/india_today.recipe b/recipes/india_today.recipe index 0b6f15ef91..8654a99ef6 100644 --- a/recipes/india_today.recipe +++ b/recipes/india_today.recipe @@ -114,7 +114,6 @@ class IndiaToday(BasicNewsRecipe): if 'image_caption' in data: imagecap = '
' + data['image_caption'] + '
' - html = '' + slug + '

' + title + '

\n' + desc + '
'\ - + author + ' ' + city + ' UPDATED: ' + date + '
\n' + image + imagecap + body\ - + '' - return html + return ('' + slug + '

' + title + '

\n' + desc + '
' + + author + ' ' + city + ' UPDATED: ' + date + '
\n' + image + imagecap + body + + '') diff --git a/recipes/montreal_gazette.recipe b/recipes/montreal_gazette.recipe index a996244c12..5b9bc97f92 100644 --- a/recipes/montreal_gazette.recipe +++ b/recipes/montreal_gazette.recipe @@ -154,8 +154,7 @@ class CanWestPaper(BasicNewsRecipe): except: while daysback < 7: cover = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg' + \ - str((date.today() - timedelta(days=daysback)).day) + \ - '/lg/' + self.fp_tag + '.jpg' + str((date.today() - timedelta(days=daysback)).day) + '/lg/' + self.fp_tag + '.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/nrc_next.recipe b/recipes/nrc_next.recipe index bcc5e4931c..237feaac3c 100644 --- a/recipes/nrc_next.recipe +++ b/recipes/nrc_next.recipe @@ -45,8 +45,7 @@ class NRCNext(BasicNewsRecipe): raise ValueError('Failed to login, check username and password') epubraw = None for today in (date.today(), date.today() - timedelta(days=1),): - url = 'http://digitaleeditie.nrc.nl/digitaleeditie/helekrant/epub/nn_%s.epub' \ - % today.strftime('%Y%m%d') + url = 'http://digitaleeditie.nrc.nl/digitaleeditie/helekrant/epub/nn_%s.epub' % today.strftime('%Y%m%d') self.log('Trying to download epub from:', url) try: response3 = br.open(url, timeout=60) diff --git a/recipes/ottawa_citizen.recipe b/recipes/ottawa_citizen.recipe index b6134f7b99..b3b35e4155 100644 --- a/recipes/ottawa_citizen.recipe +++ b/recipes/ottawa_citizen.recipe @@ -154,8 +154,7 @@ class CanWestPaper(BasicNewsRecipe): except: while daysback < 7: cover = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg' + \ - str((date.today() - timedelta(days=daysback)).day) + \ - '/lg/' + self.fp_tag + '.jpg' + str((date.today() - timedelta(days=daysback)).day) + '/lg/' + self.fp_tag + '.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/people_daily.recipe b/recipes/people_daily.recipe index f6521fdbff..e03f10a52d 100644 --- a/recipes/people_daily.recipe +++ b/recipes/people_daily.recipe @@ -128,8 +128,8 @@ class AdvancedUserRecipe1277129332(BasicNewsRecipe): year = time.strftime('%Y') month = time.strftime('%m') day = time.strftime('%d') - cover = 'http://paper.people.com.cn/rmrb/images/' + year + '-' + \ - month + '/' + day + '/01/rmrb' + year + month + day + '01_b.jpg' + cover = ('http://paper.people.com.cn/rmrb/images/' + year + '-' + + month + '/' + day + '/01/rmrb' + year + month + day + '01_b.jpg') br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/polizeipress_de.recipe b/recipes/polizeipress_de.recipe index 6ff4a33f1e..5c89167a6e 100644 --- a/recipes/polizeipress_de.recipe +++ b/recipes/polizeipress_de.recipe @@ -25,8 +25,7 @@ class AdvancedUserRecipe(BasicNewsRecipe): def print_version(self, url): segments = url.split('/') - printURL = 'http://www.presseportal.de/print.htx?nr=' + \ - '/'.join(segments[5:6]) + '&type=polizei' + printURL = 'http://www.presseportal.de/print.htx?nr=' + '/'.join(segments[5:6]) + '&type=polizei' return printURL feeds = [(u'Frimmerdorf', u'http://www.presseportal.de/rss/rss2_vts.htx?q=Grevenbroich-frimmersdorf&w=public_service'), diff --git a/recipes/presse_portal.recipe b/recipes/presse_portal.recipe index a6940c9647..fae834986e 100644 --- a/recipes/presse_portal.recipe +++ b/recipes/presse_portal.recipe @@ -23,8 +23,7 @@ class PressePortalDE(BasicNewsRecipe): description = u'Presseportal News Feed DE' # add date to description so for dayly downloads you can find them easier # ---- can be edit by user - description = description + ' fetched: ' + \ - datetime.now().strftime('%Y-%m-%d') # %H:%M:%S") + description = description + ' fetched: ' + datetime.now().strftime('%Y-%m-%d') # %H:%M:%S") # Who published the content? publisher = u'Presseportal.de' # What is the content of? diff --git a/recipes/readitlater.recipe b/recipes/readitlater.recipe index ec6be3cc61..1c99c8b367 100644 --- a/recipes/readitlater.recipe +++ b/recipes/readitlater.recipe @@ -59,9 +59,9 @@ class Pocket(BasicNewsRecipe): fail loudly if it's missing from the config. ''' br = BasicNewsRecipe.get_browser(self, - user_agent='Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; \ - en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) \ - Version/5.0.3 Safari/533.19.4') + user_agent='''Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us) + AppleWebKit/533.19.4 (KHTML, like Gecko) + Version/5.0.3 Safari/533.19.4''') if self.username is not None and self.password is not None: br.open(self.legacy_login_url) br.select_form(nr=0) @@ -155,8 +155,7 @@ class Pocket(BasicNewsRecipe): ''' try: from calibre.ebooks.covers import calibre_cover2 - title = self.title if isinstance(self.title, type(u'')) else \ - self.title.decode('utf-8', 'replace') + title = self.title if isinstance(self.title, type(u'')) else self.title.decode('utf-8', 'replace') date = strftime(self.timefmt) time = strftime('[%I:%M %p]') img_data = calibre_cover2(title, date, time) diff --git a/recipes/regina_leader_post.recipe b/recipes/regina_leader_post.recipe index f959ca1e55..e176bf8b9e 100644 --- a/recipes/regina_leader_post.recipe +++ b/recipes/regina_leader_post.recipe @@ -113,8 +113,7 @@ class CanWestPaper(BasicNewsRecipe): except: while daysback < 7: cover = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg' + \ - str((date.today() - timedelta(days=daysback)).day) + \ - '/lg/' + self.fp_tag + '.jpg' + str((date.today() - timedelta(days=daysback)).day) + '/lg/' + self.fp_tag + '.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/saskatoon_star_phoenix.recipe b/recipes/saskatoon_star_phoenix.recipe index b32bad8a68..1d580ca01c 100644 --- a/recipes/saskatoon_star_phoenix.recipe +++ b/recipes/saskatoon_star_phoenix.recipe @@ -113,8 +113,7 @@ class CanWestPaper(BasicNewsRecipe): except: while daysback < 7: cover = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg' + \ - str((date.today() - timedelta(days=daysback)).day) + \ - '/lg/' + self.fp_tag + '.jpg' + str((date.today() - timedelta(days=daysback)).day) + '/lg/' + self.fp_tag + '.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/scmp.recipe b/recipes/scmp.recipe index 7ac31a48bf..6e3010b7ac 100644 --- a/recipes/scmp.recipe +++ b/recipes/scmp.recipe @@ -59,8 +59,7 @@ def load_article_from_json(raw, root): # E(article, 'p', replace_entities(data['subHeadline']['text']), style='font-style: italic; color:#202020;') for subh in data['subHeadline']['json']: process_node(subh, article) - auth = ts_date(data['publishedDate']) + ' | ' + str(data.get('readingTime', '')) + ' min read | ' \ - + ', '.join([a['name'] for a in data['authors']]) + auth = ts_date(data['publishedDate']) + ' | ' + str(data.get('readingTime', '')) + ' min read | ' + ', '.join([a['name'] for a in data['authors']]) E(article, 'p', auth, style='color: #202020; font-size:small;') main_image_url = sub_img = '' for l in data['images']: diff --git a/recipes/scott_hanselman.recipe b/recipes/scott_hanselman.recipe index 711258ddac..fc0ccdddc5 100644 --- a/recipes/scott_hanselman.recipe +++ b/recipes/scott_hanselman.recipe @@ -28,8 +28,8 @@ class ScottHanselman(BasicNewsRecipe): '--comment', description, '--category', category, '--publisher', publisher, '--author', author ] - html2epub_options = 'publisher="' + publisher + '"\ncomments="' + \ - description + '"\ntags="' + category + '"\nauthors="' + author + '"' + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + \ + '"\ntags="' + category + '"\nauthors="' + author + '"' remove_tags = [ dict(name=['object', 'link']), dict( diff --git a/recipes/the_philippine_daily_inquirer.recipe b/recipes/the_philippine_daily_inquirer.recipe index c9a449d9e1..a98dde90d7 100644 --- a/recipes/the_philippine_daily_inquirer.recipe +++ b/recipes/the_philippine_daily_inquirer.recipe @@ -5,8 +5,7 @@ from calibre.web.feeds.recipes import BasicNewsRecipe class PhilippineDailyInquirer(BasicNewsRecipe): title = 'The Philippine Daily Inquirer' - custom_title = 'The Philippine Daily Inquirer - ' + \ - time.strftime('%d %b %Y %I:%M %p') + custom_title = 'The Philippine Daily Inquirer - ' + time.strftime('%d %b %Y %I:%M %p') __author__ = 'jde' __date__ = '03 June 2012' __version__ = '1.0' diff --git a/recipes/theeconomictimes_india_print_edition.recipe b/recipes/theeconomictimes_india_print_edition.recipe index 415097ea48..34da739c6c 100644 --- a/recipes/theeconomictimes_india_print_edition.recipe +++ b/recipes/theeconomictimes_india_print_edition.recipe @@ -33,8 +33,8 @@ class TheEconomicTimes(BasicNewsRecipe): yr = str(date.today().year) mn = date.today().strftime('%m') dy = date.today().strftime('%d') - cover = 'https://asset.harnscloud.com/PublicationData/ET/etbg/'\ - + yr + '/' + mn + '/' + dy + '/Page/' + dy + '_' + mn + '_' + yr + '_001_etbg.jpg' + cover = ('https://asset.harnscloud.com/PublicationData/ET/etbg/' + + yr + '/' + mn + '/' + dy + '/Page/' + dy + '_' + mn + '_' + yr + '_001_etbg.jpg') self.log('cover_url ', cover) br = BasicNewsRecipe.get_browser(self) try: diff --git a/recipes/tls_mag.recipe b/recipes/tls_mag.recipe index 5f94a1094c..2be795327e 100644 --- a/recipes/tls_mag.recipe +++ b/recipes/tls_mag.recipe @@ -138,14 +138,14 @@ class TLS(BasicNewsRecipe): i = data['article_data_leadimage'] if i.get('full_image'): lede = '
{}
'.format( - i['full_image'] + '?w600', i['imagecaption'] + ' ' \ - + i['imagecredit'] + '' + i['full_image'] + '?w600', + i['imagecaption'] + ' ' + i['imagecredit'] + '' ) cont = self.index_to_soup('https://www.the-tls.co.uk/wp-json/wp/v2/tls_articles/' + data['ID'], raw=True) c_data = json.loads(cont) body = c_data['content']['rendered'] - html = '
' \ - + label + title + desc + auth + lede + bks + body + \ - '
' + html = ('
' + + label + title + desc + auth + lede + bks + body + + '
') return BeautifulSoup(html).prettify() diff --git a/recipes/toiprint.recipe b/recipes/toiprint.recipe index 33deae3573..0a76422ede 100644 --- a/recipes/toiprint.recipe +++ b/recipes/toiprint.recipe @@ -63,8 +63,8 @@ class toiprint(BasicNewsRecipe): ''' def get_cover_url(self): - cover = 'https://asset.harnscloud.com/PublicationData/TOI/' + le + '/' \ - + date0 + '/Page/' + date_ + '_001_' + le + '.jpg' + cover = ('https://asset.harnscloud.com/PublicationData/TOI/' + + le + '/' + date0 + '/Page/' + date_ + '_001_' + le + '.jpg') self.log('cover_url ', cover) return cover @@ -135,17 +135,18 @@ class toiprint(BasicNewsRecipe): body += '

' + x['ZoneText'] + '

' elif x['TagName'] == 'Photographs': pag = x['ZoneID'].split('_')[-4] - body += '
'.format(img_index + '/Photographs/' + pag + '/' \ - + x['ZoneID'] + '.jpg&bucket=andre-toi-out&q=50') + body += '
'.format( + '/'.join([img_index, 'Photographs', pag, x['ZoneID']]) + '.jpg&bucket=andre-toi-out&q=50' + ) elif x['TagName'] == 'ImageCaption': body += '
' + x['ZoneText'] + '

' elif x['TagName'] == 'Lead': body += '

' + x['ZoneText'] + '

' elif 'ZoneText' in x: body += '

' + x['ZoneText'] + '

' - return '
' \ - + body.replace('
', '

').replace('
', '

').replace('<br>', '

').replace('\n', '
') \ - + '

' + return ('
' + + body.replace('
', '

').replace('
', '

').replace('<br>', '

').replace('\n', '
') + + '

') def preprocess_html(self, soup): h1 = soup.find('h1') diff --git a/recipes/vancouver_province.recipe b/recipes/vancouver_province.recipe index 49e4c09d4c..0644c70dda 100644 --- a/recipes/vancouver_province.recipe +++ b/recipes/vancouver_province.recipe @@ -154,8 +154,7 @@ class CanWestPaper(BasicNewsRecipe): except: while daysback < 7: cover = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg' + \ - str((date.today() - timedelta(days=daysback)).day) + \ - '/lg/' + self.fp_tag + '.jpg' + str((date.today() - timedelta(days=daysback)).day) + '/lg/' + self.fp_tag + '.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/vancouver_sun.recipe b/recipes/vancouver_sun.recipe index f123f8b2d6..603ada2e93 100644 --- a/recipes/vancouver_sun.recipe +++ b/recipes/vancouver_sun.recipe @@ -155,8 +155,7 @@ class CanWestPaper(BasicNewsRecipe): except: while daysback < 7: cover = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg' + \ - str((date.today() - timedelta(days=daysback)).day) + \ - '/lg/' + self.fp_tag + '.jpg' + str((date.today() - timedelta(days=daysback)).day) + '/lg/' + self.fp_tag + '.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/vic_times.recipe b/recipes/vic_times.recipe index 39e3f918a3..113086da9c 100644 --- a/recipes/vic_times.recipe +++ b/recipes/vic_times.recipe @@ -117,8 +117,7 @@ class TimesColonist(BasicNewsRecipe): except: while daysback < 7: cover = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg' + \ - str((date.today() - timedelta(days=daysback)).day) + \ - '/lg/' + self.fp_tag + '.jpg' + str((date.today() - timedelta(days=daysback)).day) + '/lg/' + self.fp_tag + '.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/recipes/wash_post.recipe b/recipes/wash_post.recipe index f0fa53cad8..741d589557 100644 --- a/recipes/wash_post.recipe +++ b/recipes/wash_post.recipe @@ -87,8 +87,8 @@ class TheWashingtonPost(BasicNewsRecipe): author = '' if 'credits' in data: - author = '
' + 'By ' + ', '.join(x['name'] for x in data['credits']['by']) \ - + ' | ' + data['publish_date'][:-14] + '
' + author = ('
' + 'By ' + ', '.join(x['name'] for x in data['credits']['by']) + + ' | ' + data['publish_date'][:-14] + '
') body = '' for x in data['content_elements']: diff --git a/recipes/wash_post_print.recipe b/recipes/wash_post_print.recipe index 46e77b454d..14db183c43 100644 --- a/recipes/wash_post_print.recipe +++ b/recipes/wash_post_print.recipe @@ -77,8 +77,8 @@ class wapoprint(BasicNewsRecipe): author = '' if 'credits' in data: - author = '
' + 'By ' + ', '.join(x['name'] for x in data['credits']['by']) \ - + ' | ' + data['publish_date'][:-14] + '
' + author = ('
' + 'By ' + ', '.join(x['name'] for x in data['credits']['by']) + + ' | ' + data['publish_date'][:-14] + '
') body = '' for x in data['content_elements']: diff --git a/recipes/windsor_star.recipe b/recipes/windsor_star.recipe index a2d37565f7..24c041f9c3 100644 --- a/recipes/windsor_star.recipe +++ b/recipes/windsor_star.recipe @@ -113,8 +113,7 @@ class CanWestPaper(BasicNewsRecipe): except: while daysback < 7: cover = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg' + \ - str((date.today() - timedelta(days=daysback)).day) + \ - '/lg/' + self.fp_tag + '.jpg' + str((date.today() - timedelta(days=daysback)).day) + '/lg/' + self.fp_tag + '.jpg' br = BasicNewsRecipe.get_browser(self) try: br.open(cover) diff --git a/src/calibre/devices/cli.py b/src/calibre/devices/cli.py index cab3cbf152..2b7bbb633f 100755 --- a/src/calibre/devices/cli.py +++ b/src/calibre/devices/cli.py @@ -281,12 +281,12 @@ def main(): elif command == 'info': info(dev) elif command == 'cp': - usage='usage: %prog cp [options] source destination\nCopy files to/from the device\n\n'+\ - 'One of source or destination must be a path on the device. \n\nDevice paths have the form\n'+\ - 'dev:mountpoint/my/path\n'+\ - 'where mountpoint is one of / or carda: or cardb:/\n\n'+\ - 'source must point to a file for which you have read permissions\n'+\ - 'destination must point to a file or folder for which you have write permissions' + usage=('usage: %prog cp [options] source destination\nCopy files to/from the device\n\n' + 'One of source or destination must be a path on the device. \n\nDevice paths have the form\n' + 'dev:mountpoint/my/path\n' + 'where mountpoint is one of / or carda: or cardb:/\n\n' + 'source must point to a file for which you have read permissions\n' + 'destination must point to a file or folder for which you have write permissions') parser = OptionParser(usage=usage) parser.add_option('-f', '--force', dest='force', action='store_true', default=False, help='Overwrite the destination file if it exists already.') diff --git a/src/calibre/devices/errors.py b/src/calibre/devices/errors.py index bd6c2f301e..36d6b03c54 100644 --- a/src/calibre/devices/errors.py +++ b/src/calibre/devices/errors.py @@ -133,10 +133,10 @@ class ControlError(ProtocolError): def __str__(self): if self.query and self.response: - return 'Got unexpected response:\n' + \ - 'query:\n'+str(self.query.query)+'\n'+\ - 'expected:\n'+str(self.query.response)+'\n' +\ - 'actual:\n'+str(self.response) + return ('Got unexpected response:\n' + 'query:\n'+str(self.query.query)+'\n' + 'expected:\n'+str(self.query.response)+'\n' + 'actual:\n'+str(self.response)) if self.desc: return self.desc return 'Unknown control error occurred' diff --git a/src/calibre/ebooks/lrf/meta.py b/src/calibre/ebooks/lrf/meta.py index 1290e11e58..435c0a7a54 100644 --- a/src/calibre/ebooks/lrf/meta.py +++ b/src/calibre/ebooks/lrf/meta.py @@ -53,9 +53,7 @@ class field: def __repr__(self): typ = {DWORD: 'unsigned int', 'QWORD': 'unsigned long long', BYTE: 'unsigned char', WORD: 'unsigned short'}.get(self._fmt, '') - return 'An ' + typ + ' stored in ' + \ - str(struct.calcsize(self._fmt)) + \ - ' bytes starting at byte ' + str(self._start) + return 'An ' + typ + ' stored in ' + str(struct.calcsize(self._fmt)) + ' bytes starting at byte ' + str(self._start) class versioned_field(field): @@ -110,8 +108,8 @@ class fixed_stringfield: obj.pack(val, start=self._start, fmt='<'+str(len(val))+'s') def __repr__(self): - return 'A string of length ' + str(self._length) + \ - ' starting at byte ' + str(self._start) + return ('A string of length ' + str(self._length) + + ' starting at byte ' + str(self._start)) class xml_attr_field: diff --git a/src/calibre/ebooks/metadata/book/base.py b/src/calibre/ebooks/metadata/book/base.py index e10df6e3f6..e72a135256 100644 --- a/src/calibre/ebooks/metadata/book/base.py +++ b/src/calibre/ebooks/metadata/book/base.py @@ -702,8 +702,7 @@ class Metadata: res = cmeta['is_multiple']['list_to_ui'].join(res) elif datatype == 'series' and series_with_index: if self.get_extra(key) is not None: - res = res + \ - ' [%s]'%self.format_series_index(val=self.get_extra(key)) + res = res + ' [%s]'%self.format_series_index(val=self.get_extra(key)) elif datatype == 'datetime': res = format_date(res, cmeta['display'].get('date_format','dd MMM yyyy')) elif datatype == 'bool': diff --git a/src/calibre/ebooks/metadata/kdl.py b/src/calibre/ebooks/metadata/kdl.py index 77d171eeff..31f0e13bc1 100644 --- a/src/calibre/ebooks/metadata/kdl.py +++ b/src/calibre/ebooks/metadata/kdl.py @@ -17,8 +17,7 @@ from calibre.ebooks.metadata.book.base import Metadata from polyglot.builtins import codepoint_to_chr from polyglot.urllib import parse_qs, quote_plus -URL = \ -'http://ww2.kdl.org/libcat/WhatsNext.asp?AuthorLastName={0}&AuthorFirstName=&SeriesName=&BookTitle={1}&CategoryID=0&cmdSearch=Search&Search=1&grouping=' +URL = 'http://ww2.kdl.org/libcat/WhatsNext.asp?AuthorLastName={0}&AuthorFirstName=&SeriesName=&BookTitle={1}&CategoryID=0&cmdSearch=Search&Search=1&grouping=' _ignore_starts = '\'"'+''.join(codepoint_to_chr(x) for x in list(range(0x2018, 0x201e))+[0x2032, 0x2033]) diff --git a/src/calibre/ebooks/metadata/opf2.py b/src/calibre/ebooks/metadata/opf2.py index e4be124993..628db3f5e1 100644 --- a/src/calibre/ebooks/metadata/opf2.py +++ b/src/calibre/ebooks/metadata/opf2.py @@ -1645,8 +1645,7 @@ def metadata_to_opf(mi, as_string=True, default_lang=None): mi.uuid = str(uuid.uuid4()) if not mi.book_producer: - mi.book_producer = __appname__ + ' (%s) '%__version__ + \ - '[https://calibre-ebook.com]' + mi.book_producer = __appname__ + ' (%s) '%__version__ + '[https://calibre-ebook.com]' if not mi.languages: lang = (get_lang().replace('_', '-').partition('-')[0] if default_lang diff --git a/src/calibre/ebooks/rtf2xml/fields_large.py b/src/calibre/ebooks/rtf2xml/fields_large.py index 1e3e78c117..6beec68cbb 100644 --- a/src/calibre/ebooks/rtf2xml/fields_large.py +++ b/src/calibre/ebooks/rtf2xml/fields_large.py @@ -328,8 +328,7 @@ Examples 'mi{the_dict[the_key]}' self.__override_table_final += '\n' self.__override_table_final += '\n' - self.__override_table_final += \ - 'mi 3: - msg = ('No number to process?\nthis indicates that the token \\(\\li\\) \ - should have a number and does not\nnumerator is \ - "%s"\ndenominator is "%s"\n') % (numerator, denominator) + msg = ('No number to process?\nthis indicates that the token \\(\\li\\)' + 'should have a number and does not\nnumerator is' + '"%s"\ndenominator is "%s"\n') % (numerator, denominator) raise self.__bug_handler(msg) if 5 > self.__return_code: self.__return_code = 5 diff --git a/src/calibre/ebooks/rtf2xml/tokenize.py b/src/calibre/ebooks/rtf2xml/tokenize.py index 0e9d4d184d..a3591f4f13 100644 --- a/src/calibre/ebooks/rtf2xml/tokenize.py +++ b/src/calibre/ebooks/rtf2xml/tokenize.py @@ -174,8 +174,8 @@ class Tokenize: self.__cwdigit_exp = re.compile(r'(\\[a-zA-Z]+[\-0-9]+)([^0-9 \\]+)') def tokenize(self): - '''Main class for handling other methods. Reads the file \ - , uses method self.sub_reg to make basic substitutions,\ + '''Main class for handling other methods. Reads the file, + uses method self.sub_reg to make basic substitutions, and process tokens by itself''' # read with open_for_read(self.__file) as read_obj: diff --git a/src/calibre/library/catalogs/epub_mobi_builder.py b/src/calibre/library/catalogs/epub_mobi_builder.py index 4fe7049427..3d2675db1c 100644 --- a/src/calibre/library/catalogs/epub_mobi_builder.py +++ b/src/calibre/library/catalogs/epub_mobi_builder.py @@ -556,11 +556,11 @@ class CatalogBuilder: if author[0] == current_author[0]: if self.opts.fmt == 'mobi': # Exit if building MOBI - error_msg = _('

Inconsistent author sort values for author
' + - f"'{author[0]}':

" + - f'

{author[1]} != {current_author[1]}

' + - '

Unable to build MOBI catalog.
' + - f"Select all books by '{author[0]}', apply correct Author Sort value in Edit Metadata dialog, then rebuild the catalog.\n

") # noqa: E501 + error_msg = _("

Inconsistent author sort values for author
'{0}':

" + '

{1} != {2}

' + '

Unable to build MOBI catalog.
' + "Select all books by '{0}', apply correct Author Sort value in Edit Metadata dialog, then rebuild the catalog.

" + ).format(author[0], author[1], current_author[1]) self.opts.log.warn('\n*** Metadata error ***') self.opts.log.warn(error_msg)