1
0
mirror of https://github.com/ciromattia/kcc synced 2026-01-30 00:47:37 +00:00

Made split filenames more idiot-proof

This commit is contained in:
Paweł Jastrzębski
2013-05-28 13:57:11 +02:00
parent 43ca5ac5b9
commit b068d82ccf
2 changed files with 4 additions and 4 deletions

View File

@@ -256,7 +256,7 @@ def buildOPF(profile, dstdir, title, filelist, cover=None):
f.write("</manifest>\n<spine toc=\"ncx\">\n")
splitCountUsed = 1
for entry in reflist:
if entry.endswith("-000001") or entry.endswith("-1"):
if entry.endswith("-kcca"):
# noinspection PyRedundantParentheses
if ((options.righttoleft and facing == 'left') or (not options.righttoleft and facing == 'right')) and\
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")
else:
f.write("<itemref idref=\"page_" + entry + "\"/>\n")
elif entry.endswith("-000002") or entry.endswith("-2"):
elif entry.endswith("-kccb"):
if options.landscapemode:
f.write("<itemref idref=\"page_" + entry + "\" properties=\"page-spread-" + facing2 + "\"/>\n")
else:

View File

@@ -218,8 +218,8 @@ class ComicPage:
leftbox = (0, 0, width, height / 2)
rightbox = (0, height / 2, width, height)
filename = os.path.splitext(os.path.basename(self.origFileName))
fileone = targetdir + '/' + filename[0] + '-1' + filename[1]
filetwo = targetdir + '/' + filename[0] + '-2' + filename[1]
fileone = targetdir + '/' + filename[0] + '-kcca' + filename[1]
filetwo = targetdir + '/' + filename[0] + '-kccb' + filename[1]
try:
if righttoleft:
pageone = self.image.crop(rightbox)