mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Have amazon kindle plugin open astore in external browser
This commit is contained in:
parent
498b79e6d5
commit
1633c8f8d0
@ -1047,6 +1047,6 @@ from calibre.gui2.store.feedbooks_plugin import FeedbooksStore
|
||||
from calibre.gui2.store.manybooks_plugin import ManyBooksStore
|
||||
from calibre.gui2.store.smashwords_plugin import SmashwordsStore
|
||||
|
||||
plugins += [GutenbergStore, FeedbooksStore, ManyBooksStore, SmashwordsStore]
|
||||
plugins += [AmazonKindleStore, GutenbergStore, FeedbooksStore, ManyBooksStore, SmashwordsStore]
|
||||
|
||||
# }}}
|
||||
|
@ -10,6 +10,8 @@ from contextlib import closing
|
||||
|
||||
from lxml import html
|
||||
|
||||
from PyQt4.Qt import QUrl
|
||||
|
||||
from calibre import browser
|
||||
from calibre.customize import StorePlugin
|
||||
from calibre.gui2.store.search_result import SearchResult
|
||||
@ -19,13 +21,12 @@ class AmazonKindleStore(StorePlugin):
|
||||
name = 'Amazon Kindle'
|
||||
description = _('Buy Kindle books from Amazon')
|
||||
|
||||
ASTORE_URL = 'http://astore.amazon.com/josbl0e-20/'
|
||||
|
||||
def open(self, gui, parent=None, detail_item=None):
|
||||
from calibre.gui2.store.web_store_dialog import WebStoreDialog
|
||||
d = WebStoreDialog(gui, self.ASTORE_URL, parent, detail_item)
|
||||
d.setWindowTitle(self.name)
|
||||
d = d.exec_()
|
||||
from calibre.gui2 import open_url
|
||||
astore_link = 'http://astore.amazon.com/josbl0e-20'
|
||||
if detail_item:
|
||||
astore_link += detail_item
|
||||
open_url(QUrl(astore_link))
|
||||
|
||||
def search(self, query, max_results=10, timeout=60):
|
||||
url = 'http://www.amazon.com/s/url=search-alias%3Ddigital-text&field-keywords=' + urllib2.quote(query)
|
||||
|
Loading…
x
Reference in New Issue
Block a user