From 8810c949332c03fc847d09d243c64b9391ecf12c Mon Sep 17 00:00:00 2001 From: un-pogaz <46523284+un-pogaz@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:14:25 +0100 Subject: [PATCH] implicit string concatenation (extra-edit) --- recipes/bbc_brasil.recipe | 36 +++++++++---------- recipes/common_dreams.recipe | 36 +++++++++---------- recipes/digizone.recipe | 6 ++-- recipes/discover_magazine_monthly.recipe | 10 +++--- recipes/folhadesaopaulo_sub.recipe | 4 +-- recipes/handelsblatt.recipe | 22 ++++++------ recipes/lupa.recipe | 6 ++-- recipes/mesec.recipe | 6 ++-- recipes/mwjournal.recipe | 36 +++++++++---------- recipes/podnikatel.recipe | 6 ++-- recipes/respekt_magazine.recipe | 22 ++++++------ recipes/satmagazine.recipe | 36 +++++++++---------- recipes/tagesan.recipe | 8 ++--- recipes/vitalia.recipe | 10 +++--- recipes/zaobao.recipe | 30 ++++++++-------- recipes/zeitde.recipe | 8 ++--- src/calibre/devices/kobo/driver.py | 24 ++++++------- src/calibre/ebooks/rtf2xml/colors.py | 3 +- src/calibre/ebooks/rtf2xml/convert_to_tags.py | 2 +- src/calibre/ebooks/rtf2xml/fields_large.py | 24 ++++++------- .../gui2/dialogs/confirm_delete_location.py | 4 +-- .../gui2/store/stores/litres_plugin.py | 4 +-- src/calibre/gui2/tweak_book/__init__.py | 12 ++++++- src/calibre/library/restore.py | 4 +-- src/calibre/srv/fts.py | 4 +-- src/calibre/utils/ipython.py | 4 +-- src/calibre/utils/localunzip.py | 4 +-- src/calibre/web/site_parsers/nytimes.py | 4 +-- 28 files changed, 192 insertions(+), 183 deletions(-) diff --git a/recipes/bbc_brasil.recipe b/recipes/bbc_brasil.recipe index 6c7d4fb733..d6e8619cdf 100644 --- a/recipes/bbc_brasil.recipe +++ b/recipes/bbc_brasil.recipe @@ -201,24 +201,24 @@ class BBCBrasilRecipe(BasicNewsRecipe): conversion_options = {'smarten_punctuation': True} # Specify extra CSS - overrides ALL other CSS (IE. Added last). - extra_css = 'body { font-family: verdana, helvetica, sans-serif; } \ - .introduction, .first { font-weight: bold; } \ - .cross-head { font-weight: bold; font-size: 125%; } \ - .cap, .caption { display: block; font-size: 80%; font-style: italic; } \ - .cap, .caption, .caption img, .caption span { display: block; text-align: center; margin: 5px auto; } \ - .byl, .byd, .byline img, .byline-name, .byline-title, .author-name, .author-position, \ - .correspondent-portrait img, .byline-lead-in, .name, .role, .bbc-role { display: block; \ - text-align: center; font-size: 80%; font-style: italic; margin: 1px auto; } \ - .story-date, .published, .datestamp { font-size: 80%; } \ - table { width: 100%; } \ - td img { display: block; margin: 5px auto; } \ - ul { padding-top: 10px; } \ - ol { padding-top: 10px; } \ - li { padding-top: 5px; padding-bottom: 5px; } \ - h1 { text-align: center; font-size: 175%; font-weight: bold; } \ - h2 { text-align: center; font-size: 150%; font-weight: bold; } \ - h3 { text-align: center; font-size: 125%; font-weight: bold; } \ - h4, h5, h6 { text-align: center; font-size: 100%; font-weight: bold; }' + extra_css = '''body { font-family: verdana, helvetica, sans-serif; } + .introduction, .first { font-weight: bold; } + .cross-head { font-weight: bold; font-size: 125%; } + .cap, .caption { display: block; font-size: 80%; font-style: italic; } + .cap, .caption, .caption img, .caption span { display: block; text-align: center; margin: 5px auto; } + .byl, .byd, .byline img, .byline-name, .byline-title, .author-name, .author-position, + .correspondent-portrait img, .byline-lead-in, .name, .role, .bbc-role { display: block; + text-align: center; font-size: 80%; font-style: italic; margin: 1px auto; } + .story-date, .published, .datestamp { font-size: 80%; } + table { width: 100%; } + td img { display: block; margin: 5px auto; } + ul { padding-top: 10px; } + ol { padding-top: 10px; } + li { padding-top: 5px; padding-bottom: 5px; } + h1 { text-align: center; font-size: 175%; font-weight: bold; } + h2 { text-align: center; font-size: 150%; font-weight: bold; } + h3 { text-align: center; font-size: 125%; font-weight: bold; } + h4, h5, h6 { text-align: center; font-size: 100%; font-weight: bold; }''' # Remove various tag attributes to improve the look of the ebook pages. remove_attributes = ['border', 'cellspacing', 'align', 'cellpadding', 'colspan', diff --git a/recipes/common_dreams.recipe b/recipes/common_dreams.recipe index 37f1c9fc4d..f693153402 100644 --- a/recipes/common_dreams.recipe +++ b/recipes/common_dreams.recipe @@ -33,24 +33,24 @@ class CommonDreams(BasicNewsRecipe): remove_javascript = True # Specify extra CSS - overrides ALL other CSS (IE. Added last). - extra_css = 'body { font-family: verdana, helvetica, sans-serif; } \ - .introduction, .first { font-weight: bold; } \ - .cross-head { font-weight: bold; font-size: 125%; } \ - .cap, .caption { display: block; font-size: 80%; font-style: italic; } \ - .cap, .caption, .caption img, .caption span { display: block; margin: 5px auto; } \ - .byl, .byd, .byline img, .byline-name, .byline-title, .author-name, .author-position, \ - .correspondent-portrait img, .byline-lead-in, .name, .bbc-role { display: block; \ - font-size: 80%; font-style: italic; margin: 1px auto; } \ - .story-date, .published { font-size: 80%; } \ - table { width: 100%; } \ - td img { display: block; margin: 5px auto; } \ - ul { padding-top: 10px; } \ - ol { padding-top: 10px; } \ - li { padding-top: 5px; padding-bottom: 5px; } \ - h1 { font-size: 175%; font-weight: bold; } \ - h2 { font-size: 150%; font-weight: bold; } \ - h3 { font-size: 125%; font-weight: bold; } \ - h4, h5, h6 { font-size: 100%; font-weight: bold; }' + extra_css = '''body { font-family: verdana, helvetica, sans-serif; } + .introduction, .first { font-weight: bold; } + .cross-head { font-weight: bold; font-size: 125%; } + .cap, .caption { display: block; font-size: 80%; font-style: italic; } + .cap, .caption, .caption img, .caption span { display: block; margin: 5px auto; } + .byl, .byd, .byline img, .byline-name, .byline-title, .author-name, .author-position, + .correspondent-portrait img, .byline-lead-in, .name, .bbc-role { display: block; + font-size: 80%; font-style: italic; margin: 1px auto; } + .story-date, .published { font-size: 80%; } + table { width: 100%; } + td img { display: block; margin: 5px auto; } + ul { padding-top: 10px; } + ol { padding-top: 10px; } + li { padding-top: 5px; padding-bottom: 5px; } + h1 { font-size: 175%; font-weight: bold; } + h2 { font-size: 150%; font-weight: bold; } + h3 { font-size: 125%; font-weight: bold; } + h4, h5, h6 { font-size: 100%; font-weight: bold; }''' # Remove the line breaks and float left/right and picture width/height. preprocess_regexps = [(re.compile(r'', re.IGNORECASE), lambda m: ''), diff --git a/recipes/digizone.recipe b/recipes/digizone.recipe index 5726c41782..e486daeeec 100644 --- a/recipes/digizone.recipe +++ b/recipes/digizone.recipe @@ -19,9 +19,9 @@ class DigiZoneCZ(BasicNewsRecipe): publication_type = 'newsportal' no_stylesheets = True remove_javascript = True - extra_css = 'p.perex{font-size: 1.2em; margin: 0 0 10px 0;line-height: 1.4;padding: 0 0 10px 0;font-weight: bold;} \ - p.perex img {display:none;} \ - .urs p {margin: 0 0 0.8em 0;}' + extra_css = '''p.perex{font-size: 1.2em; margin: 0 0 10px 0;line-height: 1.4;padding: 0 0 10px 0;font-weight: bold;} + p.perex img {display:none;} + .urs p {margin: 0 0 0.8em 0;}''' feeds = [ (u'Aktuality', u'http://rss.digizone.cz/aktuality'), diff --git a/recipes/discover_magazine_monthly.recipe b/recipes/discover_magazine_monthly.recipe index 56db6633b9..74626a43b4 100644 --- a/recipes/discover_magazine_monthly.recipe +++ b/recipes/discover_magazine_monthly.recipe @@ -81,11 +81,11 @@ class DiscoverMagazine(BasicNewsRecipe): preprocess_regexps = [(re.compile(r'', re.IGNORECASE), lambda m: ''), (re.compile(r'', re.IGNORECASE), lambda m: '')] - extra_css = 'body { font-family: helvetica, sans-serif; } \ - .belowdeck {font-style: italic; padding=bottom: 10px; max-width: none} \ - .caption {font-style: italic; padding=bottom: 10px; max-width: none} \ - .caption1 {font-style: italic; padding=bottom: 10px; max-width: none} \ - h2 { text-align: left; font-size: 1em; font-weight: bold; }}' + extra_css = '''body { font-family: helvetica, sans-serif; } + .belowdeck {font-style: italic; padding=bottom: 10px; max-width: none} + .caption {font-style: italic; padding=bottom: 10px; max-width: none} + .caption1 {font-style: italic; padding=bottom: 10px; max-width: none} + h2 { text-align: left; font-size: 1em; font-weight: bold; }}''' def parse_index(self): # gets current month from homepage and append to index diff --git a/recipes/folhadesaopaulo_sub.recipe b/recipes/folhadesaopaulo_sub.recipe index 1dc33272e2..35a61458f0 100644 --- a/recipes/folhadesaopaulo_sub.recipe +++ b/recipes/folhadesaopaulo_sub.recipe @@ -11,8 +11,8 @@ class FSP(BasicNewsRecipe): title = u'Folha de S\xE3o Paulo' __author__ = 'Joao Eduardo Bertacchi - lc_addicted, 2020 Leonardo Amaral - leleobhz' - description = u'Printed edition contents. Folha subscription required (UOL subscription currently not supported).' + \ - u' [Conte\xfado completo da edi\xe7\xe3o impressa. Somente para assinantes Folha. N\xE3o suporta assinantes UOL]' + description = (u'Printed edition contents. Folha subscription required (UOL subscription currently not supported).' + u' [Conte\xfado completo da edi\xe7\xe3o impressa. Somente para assinantes Folha. N\xE3o suporta assinantes UOL]') today = datetime.date.today() diff --git a/recipes/handelsblatt.recipe b/recipes/handelsblatt.recipe index ef8aa0d263..3984579592 100644 --- a/recipes/handelsblatt.recipe +++ b/recipes/handelsblatt.recipe @@ -92,17 +92,17 @@ class Handelsblatt(BasicNewsRecipe): (re.compile(r'( data-src=")([^"]*")', re.IGNORECASE), lambda match: ' src="' + match.group(2)) ] - extra_css = 'h2 {font-size: 1em; text-align: left} \ - h3 {font-size: 1em; text-align: left} \ - h4 {font-size: 1em; text-align: left; margin-bottom: 0em} \ - em {font-style: normal; font-weight: bold} \ - .vhb-subline {font-weight: normal; text-transform: uppercase} \ - .vhb-headline {font-size: 1.6em} \ - .vhb-teaser-head {margin-top: 1em; margin-bottom: 1em} \ - .vhb-hollow-area--innercontent {font-size: 0.6em} \ - .hcf-location-mark {font-weight: bold} \ - .lb-post-header {margin-top: 1em} \ - .panel-body p {margin-top: 0em}' + extra_css = '''h2 {font-size: 1em; text-align: left} + h3 {font-size: 1em; text-align: left} + h4 {font-size: 1em; text-align: left; margin-bottom: 0em} + em {font-style: normal; font-weight: bold} + .vhb-subline {font-weight: normal; text-transform: uppercase} + .vhb-headline {font-size: 1.6em} + .vhb-teaser-head {margin-top: 1em; margin-bottom: 1em} + .vhb-hollow-area--innercontent {font-size: 0.6em} + .hcf-location-mark {font-weight: bold} + .lb-post-header {margin-top: 1em} + .panel-body p {margin-top: 0em}''' def get_browser(self): br = BasicNewsRecipe.get_browser(self) diff --git a/recipes/lupa.recipe b/recipes/lupa.recipe index 02097782c5..a28be3b490 100644 --- a/recipes/lupa.recipe +++ b/recipes/lupa.recipe @@ -19,9 +19,9 @@ class LupaCZ(BasicNewsRecipe): publication_type = 'newsportal' no_stylesheets = True remove_javascript = True - extra_css = 'p.perex{font-size: 1.2em;margin: 0 0 10px 0;line-height: 1.4;padding: 0 0 10px 0;font-weight: bold;} \ - p.perex img {display:none;} \ - .urs p {margin: 0 0 0.8em 0;}' + extra_css = '''p.perex{font-size: 1.2em;margin: 0 0 10px 0;line-height: 1.4;padding: 0 0 10px 0;font-weight: bold;} + p.perex img {display:none;} + .urs p {margin: 0 0 0.8em 0;}''' feeds = [ (u'Zpr\xe1vi\u010dky', u'http://rss.lupa.cz/zpravicky'), diff --git a/recipes/mesec.recipe b/recipes/mesec.recipe index db4f1e92e0..38149bf1fa 100644 --- a/recipes/mesec.recipe +++ b/recipes/mesec.recipe @@ -19,9 +19,9 @@ class MesecCZ(BasicNewsRecipe): publication_type = 'newsportal' no_stylesheets = True remove_javascript = True - extra_css = 'p.perex{font-size: 1.2em;margin: 0 0 10px 0;line-height: 1.4;padding: 0 0 10px 0;font-weight: bold;} \ - p.perex img {display:none;} \ - .urs p {margin: 0 0 0.8em 0;}' + extra_css = '''p.perex{font-size: 1.2em;margin: 0 0 10px 0;line-height: 1.4;padding: 0 0 10px 0;font-weight: bold;} + p.perex img {display:none;} + .urs p {margin: 0 0 0.8em 0;}''' feeds = [ (u'Aktuality', u'http://www.mesec.cz/rss/aktuality/'), diff --git a/recipes/mwjournal.recipe b/recipes/mwjournal.recipe index d9ba4161b1..c1ab7555bc 100644 --- a/recipes/mwjournal.recipe +++ b/recipes/mwjournal.recipe @@ -49,24 +49,24 @@ class MWJournal(BasicNewsRecipe): 'valign', 'vspace', 'hspace', 'alt', 'width', 'height'] # Specify extra CSS - overrides ALL other CSS (IE. Added last). - extra_css = 'body { font-family: verdana, helvetica, sans-serif; } \ - .introduction, .first { font-weight: bold; } \ - .cross-head { font-weight: bold; font-size: 125%; } \ - .cap, .caption { display: block; font-size: 80%; font-style: italic; } \ - .cap, .caption, .caption img, .caption span { display: block; margin: 5px auto; } \ - .byl, .byd, .byline img, .byline-name, .byline-title, .author-name, .author-position, \ - .correspondent-portrait img, .byline-lead-in, .name, .bbc-role { display: block; \ - font-size: 80%; font-style: italic; margin: 1px auto; } \ - .story-date, .published { font-size: 80%; } \ - table { width: 100%; } \ - td img { display: block; margin: 5px auto; } \ - ul { padding-top: 10px; } \ - ol { padding-top: 10px; } \ - li { padding-top: 5px; padding-bottom: 5px; } \ - h1 { font-size: 175%; font-weight: bold; } \ - h2 { font-size: 150%; font-weight: bold; } \ - h3 { font-size: 125%; font-weight: bold; } \ - h4, h5, h6 { font-size: 100%; font-weight: bold; }' + extra_css = '''body { font-family: verdana, helvetica, sans-serif; } + .introduction, .first { font-weight: bold; } + .cross-head { font-weight: bold; font-size: 125%; } + .cap, .caption { display: block; font-size: 80%; font-style: italic; } + .cap, .caption, .caption img, .caption span { display: block; margin: 5px auto; } + .byl, .byd, .byline img, .byline-name, .byline-title, .author-name, .author-position, + .correspondent-portrait img, .byline-lead-in, .name, .bbc-role { display: block; + font-size: 80%; font-style: italic; margin: 1px auto; } + .story-date, .published { font-size: 80%; } + table { width: 100%; } + td img { display: block; margin: 5px auto; } + ul { padding-top: 10px; } + ol { padding-top: 10px; } + li { padding-top: 5px; padding-bottom: 5px; } + h1 { font-size: 175%; font-weight: bold; } + h2 { font-size: 150%; font-weight: bold; } + h3 { font-size: 125%; font-weight: bold; } + h4, h5, h6 { font-size: 100%; font-weight: bold; }''' # Remove the line breaks, href links and float left/right and picture # width/height. diff --git a/recipes/podnikatel.recipe b/recipes/podnikatel.recipe index 785bbad039..c374860863 100644 --- a/recipes/podnikatel.recipe +++ b/recipes/podnikatel.recipe @@ -19,9 +19,9 @@ class PodnikatelCZ(BasicNewsRecipe): publication_type = 'newsportal' no_stylesheets = True remove_javascript = True - extra_css = 'p.perex{font-size: 1.2em; margin: 0 0 10px 0;line-height: 1.4;padding: 0 0 10px 0;font-weight: bold;} \ - p.perex img {display:none;} \ - .urs p {margin: 0 0 0.8em 0;}' + extra_css = '''p.perex{font-size: 1.2em; margin: 0 0 10px 0;line-height: 1.4;padding: 0 0 10px 0;font-weight: bold;} + p.perex img {display:none;} + .urs p {margin: 0 0 0.8em 0;}''' feeds = [ (u'Aktuality', u'http://rss.podnikatel.cz/aktuality'), diff --git a/recipes/respekt_magazine.recipe b/recipes/respekt_magazine.recipe index 0bdf144b72..28faad637a 100644 --- a/recipes/respekt_magazine.recipe +++ b/recipes/respekt_magazine.recipe @@ -37,17 +37,17 @@ class respektRecipe(BasicNewsRecipe): dict(name='script') ] - extra_css = 'p {text-align:justify;margin-top:0;margin-bottom:0} \ - ul {color:black} \ - .frame-caption {font-weight:normal;font-size:50%;font-style:italic;} \ - h1 {font-size:150%;margin-bottom:0;} \ - h2 {font-size:100%;margin-bottom:0;} \ - .post-subtitle {margin-top:0;} \ - h3 {font-size:100%;margin-bottom:0;margin-top:0;} \ - .box-title {background-color: lightgray;font-size:150%;font-weight:bold;margin-left:12%;margin-right:12%;margin-top:12%;margin-bottom:0;} \ - .box-content {background-color:lightgray;margin-left:12%;margin-right:12%;margin-top:0;margin-bottom:12%;} \ - p.indent_first_line {text-indent:30px;} \ - a {text-decoration:none;color:black;}' + extra_css = '''p {text-align:justify;margin-top:0;margin-bottom:0} + ul {color:black} + .frame-caption {font-weight:normal;font-size:50%;font-style:italic;} + h1 {font-size:150%;margin-bottom:0;} + h2 {font-size:100%;margin-bottom:0;} + .post-subtitle {margin-top:0;} + h3 {font-size:100%;margin-bottom:0;margin-top:0;} + .box-title {background-color: lightgray;font-size:150%;font-weight:bold;margin-left:12%;margin-right:12%;margin-top:12%;margin-bottom:0;} + .box-content {background-color:lightgray;margin-left:12%;margin-right:12%;margin-top:0;margin-bottom:12%;} + p.indent_first_line {text-indent:30px;} + a {text-decoration:none;color:black;}''' needs_subscription = True diff --git a/recipes/satmagazine.recipe b/recipes/satmagazine.recipe index 92577a09b6..c5388083dd 100644 --- a/recipes/satmagazine.recipe +++ b/recipes/satmagazine.recipe @@ -47,24 +47,24 @@ class SatMagazine(BasicNewsRecipe): 'valign', 'vspace', 'hspace', 'alt', 'width', 'height'] # Specify extra CSS - overrides ALL other CSS (IE. Added last). - extra_css = 'body { font-family: verdana, helvetica, sans-serif; } \ - .introduction, .first { font-weight: bold; } \ - .cross-head { font-weight: bold; font-size: 125%; } \ - .cap, .caption { display: block; font-size: 80%; font-style: italic; } \ - .cap, .caption, .caption img, .caption span { display: block; margin: 5px auto; } \ - .byl, .byd, .byline img, .byline-name, .byline-title, .author-name, .author-position, \ - .correspondent-portrait img, .byline-lead-in, .name, .bbc-role { display: block; \ - font-size: 80%; font-style: italic; margin: 1px auto; } \ - .story-date, .published { font-size: 80%; } \ - table { width: 100%; } \ - td img { display: block; margin: 5px auto; } \ - ul { padding-top: 10px; } \ - ol { padding-top: 10px; } \ - li { padding-top: 5px; padding-bottom: 5px; } \ - h1 { font-size: 175%; font-weight: bold; } \ - h2 { font-size: 150%; font-weight: bold; } \ - h3 { font-size: 125%; font-weight: bold; } \ - h4, h5, h6 { font-size: 100%; font-weight: bold; }' + extra_css = '''body { font-family: verdana, helvetica, sans-serif; } + .introduction, .first { font-weight: bold; } + .cross-head { font-weight: bold; font-size: 125%; } + .cap, .caption { display: block; font-size: 80%; font-style: italic; } + .cap, .caption, .caption img, .caption span { display: block; margin: 5px auto; } + .byl, .byd, .byline img, .byline-name, .byline-title, .author-name, .author-position, + .correspondent-portrait img, .byline-lead-in, .name, .bbc-role { display: block; + font-size: 80%; font-style: italic; margin: 1px auto; } + .story-date, .published { font-size: 80%; } + table { width: 100%; } + td img { display: block; margin: 5px auto; } + ul { padding-top: 10px; } + ol { padding-top: 10px; } + li { padding-top: 5px; padding-bottom: 5px; } + h1 { font-size: 175%; font-weight: bold; } + h2 { font-size: 150%; font-weight: bold; } + h3 { font-size: 125%; font-weight: bold; } + h4, h5, h6 { font-size: 100%; font-weight: bold; }''' # Remove the line breaks, href links and float left/right and picture # width/height. diff --git a/recipes/tagesan.recipe b/recipes/tagesan.recipe index f80f337c2b..f8874ac85d 100644 --- a/recipes/tagesan.recipe +++ b/recipes/tagesan.recipe @@ -41,10 +41,10 @@ class AdvancedUserRecipe1450864843(BasicNewsRecipe): conversion_options = {'base_font_size': 12} - extra_css = 'h1 { font-size: 150%; font-weight: bold; } \ - h2 { font-size: 120%; font-weight: bold; } \ - h3 { font-size: 100%; font-style: italic; } \ - h4, h5, h6 { font-size: 100%; font-style: italic; }' + extra_css = '''h1 { font-size: 150%; font-weight: bold; } + h2 { font-size: 120%; font-weight: bold; } + h3 { font-size: 100%; font-style: italic; } + h4, h5, h6 { font-size: 100%; font-style: italic; }''' def get_cover_url(self): self.cover_url = 'http://newsmail.cleartext.ch/referenz_tagesanzeiger.jpg' diff --git a/recipes/vitalia.recipe b/recipes/vitalia.recipe index 016f223581..d6fc0dc0c7 100644 --- a/recipes/vitalia.recipe +++ b/recipes/vitalia.recipe @@ -19,11 +19,11 @@ class VitaliaCZ(BasicNewsRecipe): publication_type = 'newsportal' no_stylesheets = True remove_javascript = True - extra_css = 'p.perex{font-size: 1.2em; margin: 0 0 10px 0; line-height: 1.4; padding: 0 0 10px 0; font-weight: bold;} \ - p.perex img {display:none;} \ - span.author {font-size:0.8em; font-style:italic} \ - .urs div.rs-tip-major {padding:0.5em; background: #e0e0e0 none repeat scroll 0 0;border: 1px solid #909090;} \ - .urs p {margin: 0 0 0.8em 0;}' + extra_css = '''p.perex{font-size: 1.2em; margin: 0 0 10px 0; line-height: 1.4; padding: 0 0 10px 0; font-weight: bold;} + p.perex img {display:none;} + span.author {font-size:0.8em; font-style:italic} + .urs div.rs-tip-major {padding:0.5em; background: #e0e0e0 none repeat scroll 0 0;border: 1px solid #909090;} + .urs p {margin: 0 0 0.8em 0;}''' feeds = [ (u'Aktuality', 'http://www.vitalia.cz/rss/aktuality/'), diff --git a/recipes/zaobao.recipe b/recipes/zaobao.recipe index a53e252c06..16e7f355c6 100644 --- a/recipes/zaobao.recipe +++ b/recipes/zaobao.recipe @@ -32,21 +32,21 @@ class ZAOBAO(BasicNewsRecipe): dict(name='div', attrs={'width': '30%'}), ] - extra_css = '\n\ - @font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)}\n\ - body{font-family: serif1, serif}\n\ - .article_description{font-family: serif1, serif}\n\ - p{font-family: serif1, serif}\n\ - h1 {font-weight: bold; font-size: large;}\n\ - h2 {font-size: large;}\n\ - .title {font-size: large;}\n\ - .article {font-size:medium}\n\ - .navbar {font-size: small}\n\ - .feed{font-size: medium}\n\ - .small{font-size: small;padding-right: 8pt}\n\ - .text{padding-right: 8pt}\n\ - p{text-indent: 0cm}\n\ - div#content{padding-right: 10pt}' + extra_css = ''' + @font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} + body{font-family: serif1, serif} + .article_description{font-family: serif1, serif} + p{font-family: serif1, serif} + h1 {font-weight: bold; font-size: large;} + h2 {font-size: large;} + .title {font-size: large;} + .article {font-size:medium} + .navbar {font-size: small} + .feed{font-size: medium} + .small{font-size: small;padding-right: 8pt} + .text{padding-right: 8pt} + p{text-indent: 0cm} + div#content{padding-right: 10pt}''' INDEXES = [ (u'\u65b0\u95fb\u56fe\u7247', diff --git a/recipes/zeitde.recipe b/recipes/zeitde.recipe index d10c212b52..01dc419c61 100644 --- a/recipes/zeitde.recipe +++ b/recipes/zeitde.recipe @@ -45,10 +45,10 @@ class ZeitDe(BasicNewsRecipe): masthead_url = 'https://static.zeit.de/p/zeit.web/3.714/images/structured-data-publisher-logo-zon.png' - extra_css = '.figure__text { font-size: 0.9em; font-style: italic; } \ - .figure__copyright { font-size: 0.9em; font-style: italic; color: #888; } \ - .article-heading__kicker { font-size: 0.5em; display: block; margin-bottom: 1em; } \ - p.summary { font-size: 1.3em; font-style: italic; } ' + extra_css = '''.figure__text { font-size: 0.9em; font-style: italic; } + .figure__copyright { font-size: 0.9em; font-style: italic; color: #888; } + .article-heading__kicker { font-size: 0.5em; display: block; margin-bottom: 1em; } + p.summary { font-size: 1.3em; font-style: italic; } ''' remove_tags = [ dict(name='aside', class_='topicbox'), diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index 9878437466..5c376c0004 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -3025,16 +3025,16 @@ class KOBOTOUCH(KOBO): if show_debug: debug_print('KoboTouch:set_filesize_in_device_database contentID="%s"'%contentID) - test_query = 'SELECT ___FileSize ' \ - 'FROM content ' \ - 'WHERE ContentID = ? ' \ - ' AND ContentType = 6' + test_query = ('SELECT ___FileSize ' + 'FROM content ' + 'WHERE ContentID = ? ' + ' AND ContentType = 6') test_values = (contentID, ) - updatequery = 'UPDATE content ' \ - 'SET ___FileSize = ? ' \ - 'WHERE ContentId = ? ' \ - 'AND ContentType = 6' + updatequery = ('UPDATE content ' + 'SET ___FileSize = ? ' + 'WHERE ContentId = ? ' + 'AND ContentType = 6') cursor = connection.cursor() cursor.execute(test_query, test_values) @@ -3199,11 +3199,11 @@ class KOBOTOUCH(KOBO): ) shelf_type = 'UserTag' # if self.supports_reading_list else None if self.dbversion < 64: - addquery += ' ("CreationDate","InternalName","LastModified","Name","_IsDeleted","_IsVisible","_IsSynced")'\ - ' VALUES (?, ?, ?, ?, ?, ?, ?)' + addquery += ' ("CreationDate","InternalName","LastModified","Name","_IsDeleted","_IsVisible","_IsSynced")' + addquery += ' VALUES (?, ?, ?, ?, ?, ?, ?)' else: - addquery += ' ("CreationDate", "InternalName","LastModified","Name","_IsDeleted","_IsVisible","_IsSynced", "Id", "Type")'\ - ' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)' + addquery += ' ("CreationDate", "InternalName","LastModified","Name","_IsDeleted","_IsVisible","_IsSynced", "Id", "Type")' + addquery += ' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)' add_values = add_values +(bookshelf_name, shelf_type) if show_debug: diff --git a/src/calibre/ebooks/rtf2xml/colors.py b/src/calibre/ebooks/rtf2xml/colors.py index 03e275ae11..22a42167ce 100644 --- a/src/calibre/ebooks/rtf2xml/colors.py +++ b/src/calibre/ebooks/rtf2xml/colors.py @@ -211,8 +211,7 @@ class Colors: if hex_num is None: hex_num = '0' if self.__run_level > 3: - msg = 'no value in self.__color_dict' \ - 'for key %s at line %d\n' % (num, self.__line) + msg = 'no value in self.__color_dict for key %s at line %d\n' % (num, self.__line) raise self.__bug_handler(msg) return hex_num diff --git a/src/calibre/ebooks/rtf2xml/convert_to_tags.py b/src/calibre/ebooks/rtf2xml/convert_to_tags.py index d189903969..dd47c81517 100644 --- a/src/calibre/ebooks/rtf2xml/convert_to_tags.py +++ b/src/calibre/ebooks/rtf2xml/convert_to_tags.py @@ -66,7 +66,7 @@ class ConvertToTags: 'style-group', 'border-group','styles-in-body', 'paragraph-style-in-body', 'list-in-table', 'level-in-table', 'override-table','override-list', ) - self.__two_new_line = ('section', 'body', 'table', 'row' 'list-table') + self.__two_new_line = ('section', 'body', 'table', 'row', 'list-table') self.__state_dict = { 'default' : self.__default_func, 'mi%s\n%s'\ - 'mi%s\n%s' + 'mi%s\n%s'\ - 'mi%s\n%s' + 'mi' +__copyright__ = ('2008, Kovid Goyal kovid@kovidgoyal.net' + '2010, John Schember ') __docformat__ = 'restructuredtext en' from qt.core import QDialog, QHBoxLayout, QIcon, QLabel, QPushButton, QSizePolicy, Qt, QVBoxLayout diff --git a/src/calibre/gui2/store/stores/litres_plugin.py b/src/calibre/gui2/store/stores/litres_plugin.py index 5d6858c098..c98c11b108 100644 --- a/src/calibre/gui2/store/stores/litres_plugin.py +++ b/src/calibre/gui2/store/stores/litres_plugin.py @@ -53,8 +53,8 @@ class LitResStore(BasicStoreConfig, StorePlugin): d.exec() def search(self, query, max_results=10, timeout=60): - search_url = u'http://robot.litres.ru/pages/catalit_browser/?checkpoint=2000-01-02&'\ - 'search=%s&limit=0,%s' + search_url = (u'http://robot.litres.ru/pages/catalit_browser/?checkpoint=2000-01-02' + '&search=%s&limit=0,%s') search_url = search_url % (quote(query), max_results) counter = max_results diff --git a/src/calibre/gui2/tweak_book/__init__.py b/src/calibre/gui2/tweak_book/__init__.py index 0d681bd5f2..1b83276745 100644 --- a/src/calibre/gui2/tweak_book/__init__.py +++ b/src/calibre/gui2/tweak_book/__init__.py @@ -43,7 +43,17 @@ d['preview_background'] = 'auto' d['preview_foreground'] = 'auto' d['preview_link_color'] = 'auto' d['remove_existing_links_when_linking_sheets'] = True -d['charmap_favorites'] = list(map(ord, '\xa0\u2002\u2003\u2009\xad' '‘’“”‹›«»‚„' '—–§¶†‡©®™' '→⇒•·°±−×÷¼½½¾' '…µ¢£€¿¡¨´¸ˆ˜' 'ÀÁÂÃÄÅÆÇÈÉÊË' 'ÌÍÎÏÐÑÒÓÔÕÖØ' 'ŒŠÙÚÛÜÝŸÞßàá' 'âãäåæçèéêëìí' 'îïðñòóôõöøœš' 'ùúûüýÿþªºαΩ∞')) # noqa: E501 +d['charmap_favorites'] = list(map(ord, ('\xa0\u2002\u2003\u2009\xad' + '‘’“”‹›«»‚„' + '—–§¶†‡©®™' + '→⇒•·°±−×÷¼½½¾' + '…µ¢£€¿¡¨´¸ˆ˜' + 'ÀÁÂÃÄÅÆÇÈÉÊË' + 'ÌÍÎÏÐÑÒÓÔÕÖØ' + 'ŒŠÙÚÛÜÝŸÞßàá' + 'âãäåæçèéêëìí' + 'îïðñòóôõöøœš' + 'ùúûüýÿþªºαΩ∞'))) d['folders_for_types'] = {'style':'styles', 'image':'images', 'font':'fonts', 'audio':'audio', 'video':'video'} d['pretty_print_on_open'] = False d['disable_completion_popup_for_search'] = False diff --git a/src/calibre/library/restore.py b/src/calibre/library/restore.py index 6ec7855a1d..32331b9116 100644 --- a/src/calibre/library/restore.py +++ b/src/calibre/library/restore.py @@ -82,8 +82,8 @@ class Restore(Thread): if self.conflicting_custom_cols: ans += '\n\n' - ans += 'The following custom columns have conflicting definitions ' \ - 'and were not fully restored:\n' + ans += ('The following custom columns have conflicting definitions ' + 'and were not fully restored:\n') for x in self.conflicting_custom_cols: ans += '\t#'+x+'\n' ans += '\tused:\t%s, %s, %s, %s\n'%(self.custom_columns[x][1], diff --git a/src/calibre/srv/fts.py b/src/calibre/srv/fts.py index cc4cae42fa..e467e4151f 100644 --- a/src/calibre/srv/fts.py +++ b/src/calibre/srv/fts.py @@ -25,7 +25,7 @@ def fts_search(ctx, rd): ans = {'metadata': metadata_cache, 'indexing_status': {'left': l, 'total': t}} use_stemming = rd.query.get('use_stemming', 'y') == 'y' - query = rd.query.get('query' '') + query = rd.query.get('query') if not query: raise HTTPBadRequest('No search query specified') qid = rd.query.get('query_id') @@ -107,7 +107,7 @@ def fts_snippets(ctx, rd, book_ids): raise HTTPPreconditionRequired('Full text searching is not enabled on this library') use_stemming = rd.query.get('use_stemming', 'y') == 'y' - query = rd.query.get('query' '') + query = rd.query.get('query') if not query: raise HTTPBadRequest('No search query specified') try: diff --git a/src/calibre/utils/ipython.py b/src/calibre/utils/ipython.py index d9a6e2a40c..16f5396f32 100644 --- a/src/calibre/utils/ipython.py +++ b/src/calibre/utils/ipython.py @@ -159,8 +159,8 @@ class Exit: class Helper: def __repr__(self): - return 'Type help() for interactive help, ' \ - 'or help(object) for help about object.' + return ('Type help() for interactive help, ' + 'or help(object) for help about object.') def __call__(self, *args, **kwds): import pydoc diff --git a/src/calibre/utils/localunzip.py b/src/calibre/utils/localunzip.py index 31923806c8..95021fec53 100644 --- a/src/calibre/utils/localunzip.py +++ b/src/calibre/utils/localunzip.py @@ -37,8 +37,8 @@ LocalHeader = namedtuple('LocalHeader', if hasattr(sys, 'getwindowsversion'): windows_reserved_filenames = ( - 'CON', 'PRN', 'AUX', 'CLOCK$', 'NUL' 'COM0', 'COM1', 'COM2', 'COM3', - 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9' 'LPT0', 'LPT1', 'LPT2', + 'CON', 'PRN', 'AUX', 'CLOCK$', 'NUL', 'COM0', 'COM1', 'COM2', 'COM3', + 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'LPT0', 'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5', 'LPT6', 'LPT7', 'LPT8', 'LPT9') def is_reserved_filename(x): diff --git a/src/calibre/web/site_parsers/nytimes.py b/src/calibre/web/site_parsers/nytimes.py index 172088210d..704fb71ef6 100644 --- a/src/calibre/web/site_parsers/nytimes.py +++ b/src/calibre/web/site_parsers/nytimes.py @@ -270,8 +270,8 @@ def extract_html(soup, url): if '/interactive/' in url: return ( '

' - + 'This is an interactive article, which is supposed to be read in a browser.' - + '

' + 'This is an interactive article, which is supposed to be read in a browser.' + '

' ) script = soup.findAll('script', text=lambda x: x and 'window.__preloadedData' in x)[0] script = str(script)