Fix #3448 (Problems loading HTML files in v6.11)

This commit is contained in:
Kovid Goyal 2009-09-10 19:12:28 -06:00
parent 09ab1df5bb
commit 12eb3bf6a0
4 changed files with 17 additions and 5 deletions

View File

@ -262,9 +262,9 @@ class HTMLInput(InputFormatPlugin):
)
),
OptionRecommendation(name='unwrap_factor', recommended_value=0.5,
OptionRecommendation(name='unwrap_factor', recommended_value=None,
help=_('Average line length for line breaking if the HTML is from a '
'previous partial conversion of a PDF file.')),
'previous partial conversion of a PDF file. Default is %default.')),
])

View File

@ -773,6 +773,7 @@ class Manifest(object):
data = self.oeb.decode(data)
data = self.oeb.html_preprocessor(data)
# Remove DOCTYPE declaration as it messes up parsing
# Inparticular it causes tostring to insert xmlns
# declarations, which messes up the coercing logic

View File

@ -98,9 +98,10 @@ STANZA_TEMPLATE='''\
'''
def send_message(msg=''):
prints('Notifying calibre of the change')
from calibre.utils.ipc import RC
import time
t = RC()
t = RC(print_error=False)
t.start()
time.sleep(3)
if t.done:

View File

@ -16,10 +16,20 @@ ADDRESS = r'\\.\pipe\CalibreGUI' if iswindows else \
class RC(Thread):
def __init__(self, print_error=True):
self.print_error = print_error
Thread.__init__(self)
self.conn = None
def run(self):
from multiprocessing.connection import Client
self.done = False
self.conn = Client(ADDRESS)
self.done = True
try:
self.conn = Client(ADDRESS)
self.done = True
except:
if self.print_error:
import traceback
traceback.print_exc()