From b068d82ccf6ceb433b666691cf0691d85618b6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 28 May 2013 13:57:11 +0200 Subject: [PATCH] Made split filenames more idiot-proof --- kcc/comic2ebook.py | 4 ++-- kcc/image.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 07b6fff..4aec6dc 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -256,7 +256,7 @@ def buildOPF(profile, dstdir, title, filelist, cover=None): f.write("\n\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("\n") else: f.write("\n") - elif entry.endswith("-000002") or entry.endswith("-2"): + elif entry.endswith("-kccb"): if options.landscapemode: f.write("\n") else: diff --git a/kcc/image.py b/kcc/image.py index 4ce1a1e..4a6f675 100755 --- a/kcc/image.py +++ b/kcc/image.py @@ -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)