mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Store: Info about ACSM. Change MobileRead to use SearchResult instead of BookRef.
This commit is contained in:
parent
4c77213c9b
commit
f0a74d0677
@ -97,12 +97,12 @@ class MobileReadStore(BasicStoreConfig, StorePlugin):
|
|||||||
if not raw_data:
|
if not raw_data:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Turn books listed in the HTML file into BookRef's.
|
# Turn books listed in the HTML file into SearchResults's.
|
||||||
books = []
|
books = []
|
||||||
try:
|
try:
|
||||||
data = html.fromstring(raw_data)
|
data = html.fromstring(raw_data)
|
||||||
for book_data in data.xpath('//ul/li'):
|
for book_data in data.xpath('//ul/li'):
|
||||||
book = BookRef()
|
book = SearchResult()
|
||||||
book.detail_item = ''.join(book_data.xpath('.//a/@href'))
|
book.detail_item = ''.join(book_data.xpath('.//a/@href'))
|
||||||
book.formats = ''.join(book_data.xpath('.//i/text()'))
|
book.formats = ''.join(book_data.xpath('.//i/text()'))
|
||||||
book.formats = book.formats.strip()
|
book.formats = book.formats.strip()
|
||||||
@ -126,12 +126,6 @@ class MobileReadStore(BasicStoreConfig, StorePlugin):
|
|||||||
return self.config.get(self.name + '_book_list', [])
|
return self.config.get(self.name + '_book_list', [])
|
||||||
|
|
||||||
|
|
||||||
class BookRef(SearchResult):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
SearchResult.__init__(self)
|
|
||||||
|
|
||||||
|
|
||||||
class MobeReadStoreDialog(QDialog, Ui_Dialog):
|
class MobeReadStoreDialog(QDialog, Ui_Dialog):
|
||||||
|
|
||||||
def __init__(self, plugin, *args):
|
def __init__(self, plugin, *args):
|
||||||
|
@ -68,6 +68,18 @@ class NPWebView(QWebView):
|
|||||||
filename = get_download_filename(url, cf)
|
filename = get_download_filename(url, cf)
|
||||||
ext = os.path.splitext(filename)[1][1:].lower()
|
ext = os.path.splitext(filename)[1][1:].lower()
|
||||||
if ext not in BOOK_EXTENSIONS:
|
if ext not in BOOK_EXTENSIONS:
|
||||||
|
if ext == 'acsm':
|
||||||
|
from calibre.gui2.dialogs.confirm_delete import confirm
|
||||||
|
confirm(_('<p>You have selected to download an ebook that uses '
|
||||||
|
'the ACSM format. ACSM files are not ebook files but '
|
||||||
|
'pointers '
|
||||||
|
'<a href="http://www.adobe.com/products/digitaleditions/">'
|
||||||
|
'Adobe Digital Editions</a> (ADE) uses so it can download '
|
||||||
|
'the ebook and apply DRM to it. You will be prompted to save this '
|
||||||
|
'file to your computer. Then open it using ADE. Once ADE has '
|
||||||
|
'downloaded the actual ebook you can add the book to calibre '
|
||||||
|
'using Add and selecting the file from the ADE library folder.'),
|
||||||
|
'acsm_download', self)
|
||||||
home = os.path.expanduser('~')
|
home = os.path.expanduser('~')
|
||||||
name = QFileDialog.getSaveFileName(self,
|
name = QFileDialog.getSaveFileName(self,
|
||||||
_('File is not a supported ebook type. Save to disk?'),
|
_('File is not a supported ebook type. Save to disk?'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user