More fixes for broken ODT files generated by mk4ht

This commit is contained in:
Kovid Goyal 2013-10-19 10:22:12 +05:30
parent b4f15bb8ca
commit 26c1fd0689
3 changed files with 6 additions and 4 deletions

View File

@ -26,7 +26,7 @@ class Extract(ODF2XHTML):
if not os.path.exists('Pictures'):
os.makedirs('Pictures')
for name in zf.namelist():
if name.startswith('Pictures'):
if name.startswith('Pictures') and name not in {'Pictures', 'Pictures/'}:
data = zf.read(name)
with open(name, 'wb') as f:
f.write(data)

View File

@ -97,6 +97,7 @@ def manifestlist(manifestxml):
inpsrc = InputSource()
inpsrc.setByteStream(StringIO(manifestxml))
parser.setFeature(handler.feature_external_ges, False) # Changed by Kovid to ignore external DTDs
parser.parse(inpsrc)
return odhandler.manifest

View File

@ -598,6 +598,7 @@ def __loadxmlparts(z, manifest, doc, objectpath):
inpsrc = InputSource()
inpsrc.setByteStream(StringIO(xmlpart))
parser.setFeature(handler.feature_external_ges, False) # Changed by Kovid to ignore external DTDs
parser.parse(inpsrc)
del doc._parsing
except KeyError, v: pass