From 30f43e14b5b405461bba5a4eb4079c780110acb9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 27 Jan 2009 11:34:02 -0800 Subject: [PATCH] Fix #1704 (Converting Bartlett's Quotation (PG) to ePUB fails) --- src/calibre/debug.py | 17 +++++++++++++++++ src/calibre/ebooks/epub/split.py | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/src/calibre/debug.py b/src/calibre/debug.py index 51669b9143..962681a267 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -83,6 +83,23 @@ def debug_device_driver(): s = DeviceScanner() s.scan() 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 for dev in devices(): print 'Looking for', dev.__name__ diff --git a/src/calibre/ebooks/epub/split.py b/src/calibre/ebooks/epub/split.py index 6128af588e..9814c40df5 100644 --- a/src/calibre/ebooks/epub/split.py +++ b/src/calibre/ebooks/epub/split.py @@ -307,7 +307,11 @@ class Splitter(LoggingInterface): Search order is: * Heading tags *
tags + *
 tags
+            * 
tags *

tags + *
tags + *

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