mirror of
https://github.com/ciromattia/kcc
synced 2026-09-01 08:27:06 +00:00
Made split filenames more idiot-proof
This commit is contained in:
+2
-2
@@ -256,7 +256,7 @@ def buildOPF(profile, dstdir, title, filelist, cover=None):
|
|||||||
f.write("</manifest>\n<spine toc=\"ncx\">\n")
|
f.write("</manifest>\n<spine toc=\"ncx\">\n")
|
||||||
splitCountUsed = 1
|
splitCountUsed = 1
|
||||||
for entry in reflist:
|
for entry in reflist:
|
||||||
if entry.endswith("-000001") or entry.endswith("-1"):
|
if entry.endswith("-kcca"):
|
||||||
# noinspection PyRedundantParentheses
|
# noinspection PyRedundantParentheses
|
||||||
if ((options.righttoleft and facing == 'left') or (not options.righttoleft and facing == 'right')) and\
|
if ((options.righttoleft and facing == 'left') or (not options.righttoleft and facing == 'right')) and\
|
||||||
options.landscapemode:
|
options.landscapemode:
|
||||||
@@ -266,7 +266,7 @@ def buildOPF(profile, dstdir, title, filelist, cover=None):
|
|||||||
f.write("<itemref idref=\"page_" + entry + "\" properties=\"page-spread-" + facing1 + "\"/>\n")
|
f.write("<itemref idref=\"page_" + entry + "\" properties=\"page-spread-" + facing1 + "\"/>\n")
|
||||||
else:
|
else:
|
||||||
f.write("<itemref idref=\"page_" + entry + "\"/>\n")
|
f.write("<itemref idref=\"page_" + entry + "\"/>\n")
|
||||||
elif entry.endswith("-000002") or entry.endswith("-2"):
|
elif entry.endswith("-kccb"):
|
||||||
if options.landscapemode:
|
if options.landscapemode:
|
||||||
f.write("<itemref idref=\"page_" + entry + "\" properties=\"page-spread-" + facing2 + "\"/>\n")
|
f.write("<itemref idref=\"page_" + entry + "\" properties=\"page-spread-" + facing2 + "\"/>\n")
|
||||||
else:
|
else:
|
||||||
|
|||||||
+2
-2
@@ -218,8 +218,8 @@ class ComicPage:
|
|||||||
leftbox = (0, 0, width, height / 2)
|
leftbox = (0, 0, width, height / 2)
|
||||||
rightbox = (0, height / 2, width, height)
|
rightbox = (0, height / 2, width, height)
|
||||||
filename = os.path.splitext(os.path.basename(self.origFileName))
|
filename = os.path.splitext(os.path.basename(self.origFileName))
|
||||||
fileone = targetdir + '/' + filename[0] + '-1' + filename[1]
|
fileone = targetdir + '/' + filename[0] + '-kcca' + filename[1]
|
||||||
filetwo = targetdir + '/' + filename[0] + '-2' + filename[1]
|
filetwo = targetdir + '/' + filename[0] + '-kccb' + filename[1]
|
||||||
try:
|
try:
|
||||||
if righttoleft:
|
if righttoleft:
|
||||||
pageone = self.image.crop(rightbox)
|
pageone = self.image.crop(rightbox)
|
||||||
|
|||||||
Reference in New Issue
Block a user