Fix #1704 (Converting Bartlett's Quotation (PG) to ePUB fails)

This commit is contained in:
Kovid Goyal 2009-01-27 11:34:02 -08:00
parent c5c98da2e2
commit 30f43e14b5
2 changed files with 22 additions and 0 deletions

View File

@ -83,6 +83,23 @@ def debug_device_driver():
s = DeviceScanner() s = DeviceScanner()
s.scan() s.scan()
print 'USB devices on system:', repr(s.devices) print 'USB devices on system:', repr(s.devices)
if iswindows:
wmi = __import__('wmi', globals(), locals(), [], -1)
drives = []
print 'Drives detected:'
print '\t', '(ID, Partitions, Drive letter)'
for drive in wmi.WMI().Win32_DiskDrive():
if drive.Partitions == 0:
continue
try:
partition = drive.associators("Win32_DiskDriveToDiskPartition")[0]
logical_disk = partition.associators('Win32_LogicalDiskToPartition')[0]
prefix = logical_disk.DeviceID+os.sep
drives.append((str(drive.PNPDeviceID), drive.Index, prefix))
except IndexError:
drives.append(str(drive.PNPDeviceID))
for drive in drives:
print '\t', drive
from calibre.devices import devices from calibre.devices import devices
for dev in devices(): for dev in devices():
print 'Looking for', dev.__name__ print 'Looking for', dev.__name__

View File

@ -307,7 +307,11 @@ class Splitter(LoggingInterface):
Search order is: Search order is:
* Heading tags * Heading tags
* <div> tags * <div> tags
* <pre> tags
* <hr> tags
* <p> tags * <p> tags
* <br> tags
* <li> tags
We try to split in the "middle" of the file (as defined by tag counts. We try to split in the "middle" of the file (as defined by tag counts.
''' '''
@ -327,6 +331,7 @@ class Splitter(LoggingInterface):
'//hr', '//hr',
'//p', '//p',
'//br', '//br',
'//li',
): ):
elems = root.xpath(path, namespaces={'re':'http://exslt.org/regular-expressions'}) elems = root.xpath(path, namespaces={'re':'http://exslt.org/regular-expressions'})
elem = pick_elem(elems) elem = pick_elem(elems)