implicit string concatenation (extra-edit)

This commit is contained in:
un-pogaz 2025-01-24 11:14:25 +01:00
parent ac4fbfc7c9
commit 8810c94933
28 changed files with 192 additions and 183 deletions

View File

@ -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',

View File

@ -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'<br[ ]*/>', re.IGNORECASE), lambda m: ''),

View File

@ -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'),

View File

@ -81,11 +81,11 @@ class DiscoverMagazine(BasicNewsRecipe):
preprocess_regexps = [(re.compile(r'<br[ ]*/>', re.IGNORECASE), lambda m: ''),
(re.compile(r'<br[ ]*clear.*/>', 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

View File

@ -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()

View File

@ -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)

View File

@ -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'),

View File

@ -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/'),

View File

@ -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.

View File

@ -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'),

View File

@ -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

View File

@ -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.

View File

@ -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'

View File

@ -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/'),

View File

@ -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',

View File

@ -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'),

View File

@ -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:

View File

@ -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

View File

@ -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<tg<open______' : self.__open_func,

View File

@ -313,20 +313,20 @@ Examples
inner_field_string = '%scb<nu<clos-brack<%s\n' % \
(instruction, last_bracket)
elif sec_in_field or par_in_field:
inner_field_string = \
'mi<mk<fldbkstart\n'\
'mi<tg<open-att__<field-block<type>%s\n%s'\
'mi<mk<fldbk-end_\n' \
'mi<tg<close_____<field-block\n'\
'mi<mk<fld-bk-end\n' \
% (instruction, inner_field_string)
inner_field_string = (
'mi<mk<fldbkstart\n'
'mi<tg<open-att__<field-block<type>%s\n%s'
'mi<mk<fldbk-end_\n'
'mi<tg<close_____<field-block\n'
'mi<mk<fld-bk-end\n'
) % (instruction, inner_field_string)
# write a marker to show an inline field for later parsing
else:
inner_field_string = \
'%s' \
'mi<tg<open-att__<field<type>%s\n%s'\
'mi<tg<close_____<field\n'\
% (self.__marker, instruction, inner_field_string)
inner_field_string = (
'%s'
'mi<tg<open-att__<field<type>%s\n%s'
'mi<tg<close_____<field\n'
) % (self.__marker, instruction, inner_field_string)
if sec_in_field:
inner_field_string = 'mi<mk<sec-fd-beg\n' + inner_field_string + \
'mi<mk<sec-fd-end\n'

View File

@ -2,8 +2,8 @@
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' \
'2010, John Schember <john@nachtimwald.com>'
__copyright__ = ('2008, Kovid Goyal kovid@kovidgoyal.net'
'2010, John Schember <john@nachtimwald.com>')
__docformat__ = 'restructuredtext en'
from qt.core import QDialog, QHBoxLayout, QIcon, QLabel, QPushButton, QSizePolicy, Qt, QVBoxLayout

View File

@ -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

View File

@ -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

View File

@ -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],

View File

@ -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:

View File

@ -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

View File

@ -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):

View File

@ -270,8 +270,8 @@ def extract_html(soup, url):
if '/interactive/' in url:
return (
'<html><body><p><em>'
+ 'This is an interactive article, which is supposed to be read in a browser.'
+ '</p></em></body></html>'
'This is an interactive article, which is supposed to be read in a browser.'
'</p></em></body></html>'
)
script = soup.findAll('script', text=lambda x: x and 'window.__preloadedData' in x)[0]
script = str(script)