From 8c6d4e66d334b05e359a7874b2806518e9d81dc8 Mon Sep 17 00:00:00 2001 From: John Schember Date: Tue, 19 Apr 2011 21:16:46 -0400 Subject: [PATCH] Store: ebooks.com drm status. --- src/calibre/gui2/store/ebooks_com_plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/gui2/store/ebooks_com_plugin.py b/src/calibre/gui2/store/ebooks_com_plugin.py index 259e996ebe..b1fc7e9c11 100644 --- a/src/calibre/gui2/store/ebooks_com_plugin.py +++ b/src/calibre/gui2/store/ebooks_com_plugin.py @@ -70,6 +70,11 @@ class EbookscomStore(BasicStoreConfig, StorePlugin): pdata = pdoc.xpath('//table[@class="price"]/tr/td/text()') if len(pdata) >= 2: price = pdata[1] + drm = False + for sec in ('Printing', 'Copying', 'Lending'): + if pdoc.xpath('boolean(//div[@class="formatTableInner"]//table//tr[contains(th, "%s") and contains(td, "Off")])' % sec): + drm = True + break if not price: continue @@ -91,5 +96,6 @@ class EbookscomStore(BasicStoreConfig, StorePlugin): s.author = author.strip() s.price = price.strip() s.detail_item = '?url=http://www.ebooks.com/cj.asp?IID=' + id.strip() + '&cjsku=' + id.strip() + s.drm = drm yield s