mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
076ca1fbb0
commit
ef43052004
@ -507,5 +507,6 @@ def main():
|
||||
keep_elements=options.keep_elements).summary().encode(enc,
|
||||
'replace'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@ -560,7 +560,6 @@ class Quickview(QDialog, Ui_Quickview):
|
||||
show=True,
|
||||
show_copy_button=False)
|
||||
|
||||
|
||||
def select_book(self, row, column):
|
||||
'''
|
||||
row and column both refer the qv table. In particular, column is not
|
||||
|
@ -66,7 +66,8 @@ def search_amazon(query, max_results=10, timeout=60,
|
||||
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
|
||||
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
|
||||
author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()'
|
||||
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()'
|
||||
price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
|
||||
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -66,7 +66,8 @@ def search_amazon(query, max_results=10, timeout=60,
|
||||
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
|
||||
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
|
||||
author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()'
|
||||
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()'
|
||||
price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
|
||||
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -68,7 +68,8 @@ def search_amazon(query, max_results=10, timeout=60,
|
||||
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
|
||||
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
|
||||
author_xpath = './/span[starts-with(text(), "%s ")]/following-sibling::span//text()' % BY
|
||||
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()'
|
||||
price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
|
||||
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -68,7 +68,8 @@ def search_amazon(query, max_results=10, timeout=60,
|
||||
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
|
||||
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
|
||||
author_xpath = './/span[starts-with(text(), "%s ")]/following-sibling::span//text()' % BY
|
||||
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()'
|
||||
price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
|
||||
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -66,7 +66,8 @@ def search_amazon(query, max_results=10, timeout=60,
|
||||
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
|
||||
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
|
||||
author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()'
|
||||
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()'
|
||||
price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
|
||||
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -68,7 +68,8 @@ def search_amazon(query, max_results=10, timeout=60,
|
||||
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
|
||||
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
|
||||
author_xpath = './/span[starts-with(text(), "%s ")]/following-sibling::span//text()' % BY
|
||||
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()'
|
||||
price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
|
||||
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -66,7 +66,8 @@ def search_amazon(query, max_results=10, timeout=60,
|
||||
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
|
||||
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
|
||||
author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()'
|
||||
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()'
|
||||
price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
|
||||
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -87,7 +87,9 @@ class EBookNLStore(BasicStoreConfig, StorePlugin):
|
||||
formats.append('PDF')
|
||||
search_result.formats = ', '.join(formats)
|
||||
|
||||
if idata.xpath('.//div[@id="book_detail_body"]/ul/li[strong[contains(., "Type")]]//span[@class="ePubAdobeDRM" or @class="ePubwatermerk" or @class="Pdfwatermark" or @class="PdfAdobeDRM"]'):
|
||||
if idata.xpath('.//div[@id="book_detail_body"]/ul/li[strong[contains(., "Type")]]'
|
||||
'//span[@class="ePubAdobeDRM" or @class="ePubwatermerk" or'
|
||||
' @class="Pdfwatermark" or @class="PdfAdobeDRM"]'):
|
||||
search_result.drm = SearchResult.DRM_LOCKED
|
||||
if idata.xpath('.//div[@id="book_detail_body"]/ul/li[strong[contains(., "Type")]]//span[@class="ePubzonderDRM"]'):
|
||||
search_result.drm = SearchResult.DRM_UNLOCKED
|
||||
|
Loading…
x
Reference in New Issue
Block a user