mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 02:43:34 +02:00
...
This commit is contained in:
parent
1968754d97
commit
a5e6a8ed66
1 changed files with 6 additions and 1 deletions
|
|
@ -392,10 +392,15 @@ def dump(self, orig_dumps):
|
|||
shutil.rmtree(tdir)
|
||||
orig = os.path.join(tdir, 'orig')
|
||||
rebuilt = os.path.join(tdir, 'rebuilt')
|
||||
for x in (orig, rebuilt):
|
||||
chunks = os.path.join(tdir, 'chunks')
|
||||
for x in (orig, rebuilt, chunks):
|
||||
os.makedirs(x)
|
||||
error = False
|
||||
for i, skeleton in enumerate(self.skeletons):
|
||||
for j, chunk in enumerate(skeleton.chunks):
|
||||
with open(os.path.join(chunks, 'file-%d-chunk-%d.html'%(i, j)),
|
||||
'wb') as f:
|
||||
f.write(chunk.raw)
|
||||
oraw, rraw = orig_dumps[i], skeleton.rebuild()
|
||||
with open(os.path.join(orig, '%04d.html'%i), 'wb') as f:
|
||||
f.write(oraw)
|
||||
|
|
|
|||
Loading…
Reference in a new issue