IGN:fixes to lit2oeb

This commit is contained in:
Kovid Goyal 2008-07-21 13:38:44 -07:00
parent 34eeb12422
commit aa6cba1e8e

View File

@ -587,11 +587,12 @@ class LitReader(object):
shared = mlist[0].path
for item in mlist[1:]:
path = item.path
while not path.startswith(shared):
shared = shared[:-1]
if shared == '':
while shared and not path.startswith(shared):
try: shared = shared[:shared.rindex("/", 0, -2) + 1]
except ValueError: shared = None
if not shared:
break
else:
if shared:
slen = len(shared)
for item in mlist:
item.path = item.path[slen:]