merge from trunk

This commit is contained in:
Lee 2011-06-13 02:50:26 +10:00
commit ee1cf18342
4 changed files with 28 additions and 13 deletions

View File

@ -597,7 +597,7 @@ class DeviceMenu(QMenu): # {{{
# }}} # }}}
class DeviceSignals(QObject): class DeviceSignals(QObject): # {{{
#: This signal is emitted once, after metadata is downloaded from the #: This signal is emitted once, after metadata is downloaded from the
#: connected device. #: connected device.
#: The sequence: gui.device_manager.is_device_connected will become True, #: The sequence: gui.device_manager.is_device_connected will become True,
@ -614,6 +614,7 @@ class DeviceSignals(QObject):
device_connection_changed = pyqtSignal(object) device_connection_changed = pyqtSignal(object)
device_signals = DeviceSignals() device_signals = DeviceSignals()
# }}}
class DeviceMixin(object): # {{{ class DeviceMixin(object): # {{{

View File

@ -139,14 +139,26 @@ class AmazonKindleStore(StorePlugin):
cover_xpath = './/div[@class="productTitle"]//img/@src' cover_xpath = './/div[@class="productTitle"]//img/@src'
title_xpath = './/div[@class="productTitle"]/a//text()' title_xpath = './/div[@class="productTitle"]/a//text()'
price_xpath = './/div[@class="newPrice"]/span/text()' price_xpath = './/div[@class="newPrice"]/span/text()'
# Vertical list of books. Search "martin" # Vertical list of books.
else: else:
# New style list. Search "Paolo Bacigalupi"
if doc.xpath('boolean(//div[@class="image"])'):
data_xpath = '//div[contains(@class, "results")]//div[contains(@class, "result")]' data_xpath = '//div[contains(@class, "results")]//div[contains(@class, "result")]'
format_xpath = './/span[@class="binding"]//text()' format_xpath = './/span[@class="binding"]//text()'
asin_xpath = './/div[@class="image"]/a[1]' asin_xpath = './/div[@class="image"]/a[1]'
cover_xpath = './/img[@class="productImage"]/@src' cover_xpath = './/img[@class="productImage"]/@src'
title_xpath = './/a[@class="title"]/text()' title_xpath = './/a[@class="title"]/text()'
price_xpath = './/span[@class="price"]/text()' price_xpath = './/span[@class="price"]/text()'
# Old style list. Search "martin"
else:
data_xpath = '//div[contains(@class, "result")]'
format_xpath = './/span[@class="format"]//text()'
asin_xpath = './/div[@class="productImage"]/a[1]'
cover_xpath = './/div[@class="productImage"]//img/@src'
title_xpath = './/div[@class="productTitle"]/a/text()'
price_xpath = './/div[@class="newPrice"]//span//text()'
for data in doc.xpath(data_xpath): for data in doc.xpath(data_xpath):
if counter <= 0: if counter <= 0:

View File

@ -26,7 +26,7 @@ from calibre.library.custom_columns import CustomColumns
from calibre.library.sqlite import connect, IntegrityError from calibre.library.sqlite import connect, IntegrityError
from calibre.library.prefs import DBPrefs from calibre.library.prefs import DBPrefs
from calibre.ebooks.metadata.book.base import Metadata from calibre.ebooks.metadata.book.base import Metadata
from calibre.constants import preferred_encoding, iswindows, isosx, filesystem_encoding from calibre.constants import preferred_encoding, iswindows, filesystem_encoding
from calibre.ptempfile import PersistentTemporaryFile from calibre.ptempfile import PersistentTemporaryFile
from calibre.customize.ui import run_plugins_on_import from calibre.customize.ui import run_plugins_on_import
from calibre import isbytestring from calibre import isbytestring
@ -188,8 +188,9 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
apply_default_prefs = not os.path.exists(self.dbpath) apply_default_prefs = not os.path.exists(self.dbpath)
self.connect() self.connect()
self.is_case_sensitive = not iswindows and not isosx and \ self.is_case_sensitive = (not iswindows and
not os.path.exists(self.dbpath.replace('metadata.db', 'MeTAdAtA.dB')) not os.path.exists(self.dbpath.replace('metadata.db',
'MeTAdAtA.dB')))
SchemaUpgrade.__init__(self) SchemaUpgrade.__init__(self)
# Guarantee that the library_id is set # Guarantee that the library_id is set
self.library_id self.library_id

View File

@ -189,7 +189,7 @@ Extra CSS
This option allows you to specify arbitrary CSS that will be applied to all HTML files in the This option allows you to specify arbitrary CSS that will be applied to all HTML files in the
input. This CSS is applied with very high priority and so should override most CSS present in input. This CSS is applied with very high priority and so should override most CSS present in
the input document itself. You can use this setting to fine tune the presentation/layout of your the **input document** itself. You can use this setting to fine tune the presentation/layout of your
document. For example, if you want all paragraphs of class `endnote` to be right aligned, just document. For example, if you want all paragraphs of class `endnote` to be right aligned, just
add:: add::
@ -200,7 +200,8 @@ or if you want to change the indentation of all paragraphs::
p { text-indent: 5mm; } p { text-indent: 5mm; }
:guilabel:`Extra CSS` is a very powerful option, but you do need an understanding of how CSS works :guilabel:`Extra CSS` is a very powerful option, but you do need an understanding of how CSS works
to use it to its full potential. to use it to its full potential. You can use the debug pipeline option described above to see what
CSS is present in your input document.
Miscellaneous Miscellaneous
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~