From ef430520042566d2dbeb4a8ce27a4b5b187556c0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 28 Jul 2017 09:20:36 +0530 Subject: [PATCH] pep8 --- src/calibre/ebooks/readability/readability.py | 1 + src/calibre/gui2/dialogs/quickview.py | 1 - src/calibre/gui2/store/stores/amazon_au_plugin.py | 3 ++- src/calibre/gui2/store/stores/amazon_ca_plugin.py | 3 ++- src/calibre/gui2/store/stores/amazon_de_plugin.py | 3 ++- src/calibre/gui2/store/stores/amazon_es_plugin.py | 3 ++- src/calibre/gui2/store/stores/amazon_in_plugin.py | 3 ++- src/calibre/gui2/store/stores/amazon_it_plugin.py | 3 ++- src/calibre/gui2/store/stores/amazon_uk_plugin.py | 3 ++- src/calibre/gui2/store/stores/ebook_nl_plugin.py | 4 +++- 10 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/calibre/ebooks/readability/readability.py b/src/calibre/ebooks/readability/readability.py index 82d1431c96..6614ebcf5e 100644 --- a/src/calibre/ebooks/readability/readability.py +++ b/src/calibre/ebooks/readability/readability.py @@ -507,5 +507,6 @@ def main(): keep_elements=options.keep_elements).summary().encode(enc, 'replace')) + if __name__ == '__main__': main() diff --git a/src/calibre/gui2/dialogs/quickview.py b/src/calibre/gui2/dialogs/quickview.py index 40066f7004..c7fcde2a0e 100644 --- a/src/calibre/gui2/dialogs/quickview.py +++ b/src/calibre/gui2/dialogs/quickview.py @@ -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 diff --git a/src/calibre/gui2/store/stores/amazon_au_plugin.py b/src/calibre/gui2/store/stores/amazon_au_plugin.py index ed925783d6..ef37e0a71e 100644 --- a/src/calibre/gui2/store/stores/amazon_au_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_au_plugin.py @@ -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 diff --git a/src/calibre/gui2/store/stores/amazon_ca_plugin.py b/src/calibre/gui2/store/stores/amazon_ca_plugin.py index 88c0957a75..baa31f91a3 100644 --- a/src/calibre/gui2/store/stores/amazon_ca_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_ca_plugin.py @@ -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 diff --git a/src/calibre/gui2/store/stores/amazon_de_plugin.py b/src/calibre/gui2/store/stores/amazon_de_plugin.py index 07bab1f669..06a6df7859 100644 --- a/src/calibre/gui2/store/stores/amazon_de_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_de_plugin.py @@ -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 diff --git a/src/calibre/gui2/store/stores/amazon_es_plugin.py b/src/calibre/gui2/store/stores/amazon_es_plugin.py index d159cd4940..859473a660 100644 --- a/src/calibre/gui2/store/stores/amazon_es_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_es_plugin.py @@ -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 diff --git a/src/calibre/gui2/store/stores/amazon_in_plugin.py b/src/calibre/gui2/store/stores/amazon_in_plugin.py index afa40fa861..1b88c529b1 100644 --- a/src/calibre/gui2/store/stores/amazon_in_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_in_plugin.py @@ -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 diff --git a/src/calibre/gui2/store/stores/amazon_it_plugin.py b/src/calibre/gui2/store/stores/amazon_it_plugin.py index 5efab2e816..a9c79448fa 100644 --- a/src/calibre/gui2/store/stores/amazon_it_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_it_plugin.py @@ -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 diff --git a/src/calibre/gui2/store/stores/amazon_uk_plugin.py b/src/calibre/gui2/store/stores/amazon_uk_plugin.py index e1390d8692..12fb9064a4 100644 --- a/src/calibre/gui2/store/stores/amazon_uk_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_uk_plugin.py @@ -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 diff --git a/src/calibre/gui2/store/stores/ebook_nl_plugin.py b/src/calibre/gui2/store/stores/ebook_nl_plugin.py index eaca1b327e..f5c5a50587 100644 --- a/src/calibre/gui2/store/stores/ebook_nl_plugin.py +++ b/src/calibre/gui2/store/stores/ebook_nl_plugin.py @@ -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