From 123a8b1c1e1016acb741b6a7d55fa8b94853592b Mon Sep 17 00:00:00 2001 From: John Schember Date: Tue, 5 Jul 2011 16:27:02 -0400 Subject: [PATCH] Store: Fix price for Smashwords store. --- src/calibre/gui2/store/stores/smashwords_plugin.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/store/stores/smashwords_plugin.py b/src/calibre/gui2/store/stores/smashwords_plugin.py index 73700ed546..7a7e756a05 100644 --- a/src/calibre/gui2/store/stores/smashwords_plugin.py +++ b/src/calibre/gui2/store/stores/smashwords_plugin.py @@ -77,9 +77,12 @@ class SmashwordsStore(BasicStoreConfig, StorePlugin): title = ''.join(data.xpath('//a[@class="bookTitle"]/text()')) subnote = ''.join(data.xpath('//span[@class="subnote"]/text()')) author = ''.join(data.xpath('//span[@class="subnote"]/a/text()')) - price = subnote.partition('$')[2] - price = price.split(u'\xa0')[0] - price = '$' + price + if '$' in subnote: + price = subnote.partition('$')[2] + price = price.split(u'\xa0')[0] + price = '$' + price + else: + price = '$0.00' counter -= 1