Simplify move_nav_to_end by calling spine.index.
This commit is contained in:
parent
7afb9fcb7a
commit
30ae76367f
1 changed files with 5 additions and 5 deletions
|
@ -1097,11 +1097,11 @@ class Epub:
|
||||||
return
|
return
|
||||||
|
|
||||||
spine = self.get_spine_order()
|
spine = self.get_spine_order()
|
||||||
for (index, id) in enumerate(spine):
|
|
||||||
if id == nav:
|
try:
|
||||||
|
index = spine.index(nav)
|
||||||
spine.append(spine.pop(index))
|
spine.append(spine.pop(index))
|
||||||
break
|
except ValueError:
|
||||||
else:
|
|
||||||
spine.append(nav)
|
spine.append(nav)
|
||||||
|
|
||||||
self.set_spine_order(spine)
|
self.set_spine_order(spine)
|
||||||
|
|
Loading…
Reference in a new issue