Merge upstream changes

This commit is contained in:
Marshall T. Vandegrift 2008-12-18 23:09:08 -05:00
commit d98e1b4ef0
4 changed files with 10 additions and 7 deletions

View File

@ -2,7 +2,7 @@ __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
__appname__ = 'calibre'
__version__ = '0.4.116'
__version__ = '0.4.117'
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
'''
Various run time constants.

View File

@ -19,10 +19,10 @@ class File(object):
self.is_readonly = not os.access(path, os.W_OK)
self.ctime = stats.st_ctime
self.wtime = stats.st_mtime
self.size = stats.st_size
if path.endswith(os.sep):
self.size = stats.st_size
if path.endswith(os.sep):
path = path[:-1]
self.path = path
self.path = path
self.name = os.path.basename(path)
@ -108,7 +108,10 @@ class PRS505(Device):
@classmethod
def get_osx_mountpoints(cls, raw=None):
if raw is None:
raw = subprocess.Popen('ioreg -w 0 -S -c IOMedia'.split(),
ioreg = '/usr/sbin/ioreg'
if not os.access(ioreg, os.X_OK):
ioreg = 'ioreg'
raw = subprocess.Popen((ioreg+' -w 0 -S -c IOMedia').split(),
stdout=subprocess.PIPE).stdout.read()
lines = raw.splitlines()
names = {}

View File

@ -677,7 +677,7 @@ class OEBBook(object):
def _toc_from_ncx(self, opf):
result = xpath(opf, '/o2:package/o2:spine/@toc')
if not result:
expr = '/o2:package/o2:manifest[@media-type="%s"]/@id'
expr = '/o2:package/o2:manifest/o2:item[@media-type="%s"]/@id'
result = xpath(opf, expr % NCX_MIME)
if len(result) != 1:
return False

View File

@ -813,7 +813,7 @@ class HTMLConverter(object, LoggingInterface):
def append_text(src):
fp, key, variant = self.font_properties(css)
for x, y in [(u'\xa0', ' '), (u'\ufb00', 'ff'), (u'\ufb01', 'fi'), (u'\ufb02', 'fl'), (u'\ufb03', 'ffi'), (u'\ufb04', 'ffl')]:
for x, y in [(u'\xad', ''), (u'\xa0', ' '), (u'\ufb00', 'ff'), (u'\ufb01', 'fi'), (u'\ufb02', 'fl'), (u'\ufb03', 'ffi'), (u'\ufb04', 'ffl')]:
src = src.replace(x, y)
valigner = lambda x: x