mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1704 (Converting Bartlett's Quotation (PG) to ePUB fails)
This commit is contained in:
parent
c5c98da2e2
commit
30f43e14b5
@ -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__
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user