mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DRYer
This commit is contained in:
parent
45db1ac43c
commit
da9426aaab
@ -281,12 +281,8 @@ def find_existing_nav_toc(container):
|
|||||||
|
|
||||||
|
|
||||||
def mark_as_nav(container, name):
|
def mark_as_nav(container, name):
|
||||||
from calibre.ebooks.metadata.opf3 import read_prefixes, set_unique_property
|
|
||||||
if container.opf_version_parsed.major > 2:
|
if container.opf_version_parsed.major > 2:
|
||||||
prefixes = read_prefixes(container.opf)
|
container.apply_unique_properties(name, 'nav')
|
||||||
href = container.href_to_name(name, container.opf_name)
|
|
||||||
if set_unique_property('nav', container.opf, prefixes, href):
|
|
||||||
container.dirty(container.opf_name)
|
|
||||||
|
|
||||||
|
|
||||||
def get_x_toc(container, find_toc, parse_toc, verify_destinations=True):
|
def get_x_toc(container, find_toc, parse_toc, verify_destinations=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user