1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

fix scribe order

This commit is contained in:
Alex Xu
2025-06-16 10:50:52 -07:00
parent ee375abfc5
commit 271200d29f
2 changed files with 17 additions and 15 deletions

View File

@@ -371,13 +371,13 @@ def buildOPF(dstdir, title, filelist, cover=None):
page_spread_property_list = []
for entry in reflist:
if options.righttoleft:
if entry.endswith("-kcc-a"):
if "-kcc-a" in entry:
page_spread_property_list.append("center")
pageside = "right"
elif entry.endswith("-kcc-b"):
elif "-kcc-b" in entry:
page_spread_property_list.append("right")
pageside = "right"
elif entry.endswith("-kcc-c"):
elif "-kcc-c" in entry:
page_spread_property_list.append("left")
pageside = "right"
else:
@@ -387,13 +387,13 @@ def buildOPF(dstdir, title, filelist, cover=None):
else:
pageside = "right"
else:
if entry.endswith("-kcc-a"):
if "-kcc-a" in entry:
page_spread_property_list.append("center")
pageside = "left"
elif entry.endswith("-kcc-b"):
elif "-kcc-b" in entry:
page_spread_property_list.append("left")
pageside = "left"
elif entry.endswith("-kcc-c"):
elif "-kcc-c" in entry:
page_spread_property_list.append("right")
pageside = "left"
else:
@@ -407,7 +407,7 @@ def buildOPF(dstdir, title, filelist, cover=None):
spread_seen = False
for i in range(len(reflist) -1, -1, -1):
entry = reflist[i]
if not entry.endswith("-kcc"):
if "-kcc-x" not in entry:
spread_seen = True
if options.righttoleft:
pageside = "left"
@@ -951,7 +951,7 @@ def detectSuboptimalProcessing(tmppath, orgpath):
for root, _, files in os.walk(tmppath, False):
for name in files:
if getImageFileName(name) is not None:
if not alreadyProcessed and getImageFileName(name)[0].endswith('-kcc'):
if not alreadyProcessed and '-kcc' in getImageFileName(name)[0]:
alreadyProcessed = True
path = os.path.join(root, name)
pathOrg = orgpath + path.split('OEBPS' + os.path.sep + 'Images')[1]