mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
e20fedd52a
commit
eef88f8f3f
@ -58,7 +58,6 @@ def to_metadata(browser, log, entry_, timeout): # {{{
|
|||||||
language = XPath('descendant::dc:language')
|
language = XPath('descendant::dc:language')
|
||||||
rating = XPath('descendant::gd:rating[@average]')
|
rating = XPath('descendant::gd:rating[@average]')
|
||||||
|
|
||||||
|
|
||||||
def get_text(extra, x):
|
def get_text(extra, x):
|
||||||
try:
|
try:
|
||||||
ans = x(extra)
|
ans = x(extra)
|
||||||
@ -70,7 +69,6 @@ def to_metadata(browser, log, entry_, timeout): # {{{
|
|||||||
log.exception('Programming error:')
|
log.exception('Programming error:')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
id_url = entry_id(entry_)[0].text
|
id_url = entry_id(entry_)[0].text
|
||||||
google_id = id_url.split('/')[-1]
|
google_id = id_url.split('/')[-1]
|
||||||
title_ = ': '.join([x.text for x in title(entry_)]).strip()
|
title_ = ': '.join([x.text for x in title(entry_)]).strip()
|
||||||
@ -274,7 +272,7 @@ class GoogleBooks(Source):
|
|||||||
goog = ans.identifiers['google']
|
goog = ans.identifiers['google']
|
||||||
for isbn in getattr(ans, 'all_isbns', []):
|
for isbn in getattr(ans, 'all_isbns', []):
|
||||||
self.cache_isbn_to_identifier(isbn, goog)
|
self.cache_isbn_to_identifier(isbn, goog)
|
||||||
if ans.has_google_cover:
|
if getattr(ans, 'has_google_cover', False):
|
||||||
self.cache_identifier_to_cover_url(goog,
|
self.cache_identifier_to_cover_url(goog,
|
||||||
self.GOOGLE_COVER%goog)
|
self.GOOGLE_COVER%goog)
|
||||||
self.clean_downloaded_metadata(ans)
|
self.clean_downloaded_metadata(ans)
|
||||||
@ -347,4 +345,3 @@ if __name__ == '__main__': # tests {{{
|
|||||||
),
|
),
|
||||||
])
|
])
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user