From a695a4c151765e983126a6037c589aa91452e554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Thu, 2 Nov 2017 10:28:43 +0100 Subject: [PATCH 1/6] Code cleanup --- kcc.py | 20 +----- kindlecomicconverter/KCC_gui.py | 20 +++--- kindlecomicconverter/cbxarchive.py | 21 +++--- kindlecomicconverter/comic2ebook.py | 100 +++++++++++++------------- kindlecomicconverter/comic2panel.py | 9 ++- kindlecomicconverter/image.py | 52 +++++++------- kindlecomicconverter/pdfjpgextract.py | 11 ++- kindlecomicconverter/shared.py | 8 +-- 8 files changed, 109 insertions(+), 132 deletions(-) diff --git a/kcc.py b/kcc.py index 618c2cbe..a6020d9e 100755 --- a/kcc.py +++ b/kcc.py @@ -34,24 +34,6 @@ else: os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + '/other/osx/:' + os.environ['PATH'] elif sys.platform.startswith('win'): - ''' - import multiprocessing.popen_spawn_win32 as forking - - class _Popen(forking.Popen): - def __init__(self, *args, **kw): - if hasattr(sys, 'frozen'): - # noinspection PyUnresolvedReferences,PyProtectedMember - os.putenv('_MEIPASS2', sys._MEIPASS) - try: - super(_Popen, self).__init__(*args, **kw) - finally: - if hasattr(sys, 'frozen'): - if hasattr(os, 'unsetenv'): - os.unsetenv('_MEIPASS2') - else: - os.putenv('_MEIPASS2', '') - forking.Popen = _Popen - ''' if getattr(sys, 'frozen', False): os.chdir(os.path.dirname(os.path.abspath(sys.executable))) else: @@ -61,7 +43,7 @@ def __init__(self, *args, **kw): if getattr(sys, 'frozen', False): try: import kindlecomicconverter.sentry - except: + except ImportError: pass from multiprocessing import freeze_support diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index a98585a1..651026a8 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -156,8 +156,8 @@ def run(self): '(' 'Changelog)', 'warning', False) - def setAnswer(self, dialogAnswer): - self.answer = dialogAnswer + def setAnswer(self, dialoganswer): + self.answer = dialoganswer def getNewVersion(self): while self.answer is None: @@ -180,8 +180,8 @@ def getNewVersion(self): MW.hideProgressBar.emit() MW.modeConvert.emit(1) - def getNewVersionTick(self, size, blockSize, totalSize): - progress = int((size / (totalSize // blockSize)) * 100) + def getNewVersionTick(self, size, blocksize, totalsize): + progress = int((size / (totalsize // blocksize)) * 100) if size == 0: MW.progressBarTick.emit('100') if progress > self.barProgress: @@ -667,10 +667,10 @@ def changeDevice(self): self.addMessage('' 'List of supported Non-Kindle devices.', 'info') - def changeFormat(self, outputFormat=None): + def changeFormat(self, outputformat=None): profile = GUI.profiles[str(GUI.deviceBox.currentText())] - if outputFormat is not None: - GUI.formatBox.setCurrentIndex(outputFormat) + if outputformat is not None: + GUI.formatBox.setCurrentIndex(outputformat) else: GUI.formatBox.setCurrentIndex(profile['DefaultFormat']) if not GUI.webtoonBox.isChecked(): @@ -881,10 +881,10 @@ def detectKindleGen(self, startup=False): else: self.addMessage('Download it and place executable in /usr/local/bin directory.', 'error') - def __init__(self, KCCAplication, KCCWindow): + def __init__(self, kccapp, kccwindow): global APP, MW, GUI - APP = KCCAplication - MW = KCCWindow + APP = kccapp + MW = kccwindow GUI = self self.setupUi(MW) self.editor = KCCGUI_MetaEditor() diff --git a/kindlecomicconverter/cbxarchive.py b/kindlecomicconverter/cbxarchive.py index 7aba70fa..fdb63938 100644 --- a/kindlecomicconverter/cbxarchive.py +++ b/kindlecomicconverter/cbxarchive.py @@ -26,13 +26,13 @@ class CBxArchive: - def __init__(self, origFileName): - self.origFileName = origFileName - if is_zipfile(origFileName): + def __init__(self, fname): + self.fname = fname + if is_zipfile(fname): self.compressor = 'zip' - elif rarfile.is_rarfile(origFileName): + elif rarfile.is_rarfile(fname): self.compressor = 'rar' - elif is_7zfile(origFileName): + elif is_7zfile(fname): self.compressor = '7z' else: self.compressor = None @@ -41,22 +41,19 @@ def isCbxFile(self): return self.compressor is not None def extractCBZ(self, targetdir): - cbzFile = ZipFile(self.origFileName) + cbzFile = ZipFile(self.fname) filelist = [] for f in cbzFile.namelist(): if f.startswith('__MACOSX') or f.endswith('.DS_Store') or f.endswith('humbs.db'): pass elif f.endswith('/'): - try: - os.makedirs(os.path.join(targetdir, f)) - except Exception: - pass + os.makedirs(os.path.join(targetdir, f), exist_ok=True) else: filelist.append(f) cbzFile.extractall(targetdir, filelist) def extractCBR(self, targetdir): - cbrFile = rarfile.RarFile(self.origFileName) + cbrFile = rarfile.RarFile(self.fname) cbrFile.extractall(targetdir) for root, _, filenames in os.walk(targetdir): for filename in filenames: @@ -64,7 +61,7 @@ def extractCBR(self, targetdir): os.remove(os.path.join(root, filename)) def extractCB7(self, targetdir): - output = Popen('7za x "' + self.origFileName + '" -xr!__MACOSX -xr!.DS_Store -xr!thumbs.db -xr!Thumbs.db -o"' + + output = Popen('7za x "' + self.fname + '" -xr!__MACOSX -xr!.DS_Store -xr!thumbs.db -xr!Thumbs.db -o"' + targetdir + '"', stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True) extracted = False for line in output.stdout: diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index e27d5e64..1689d8d6 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -198,7 +198,7 @@ def buildHTML(path, imgfile, imgfilepath): return path, imgfile -def buildNCX(dstdir, title, chapters, chapterNames): +def buildNCX(dstdir, title, chapters, chapternames): ncxfile = os.path.join(dstdir, 'OEBPS', 'toc.ncx') f = open(ncxfile, "w", encoding='UTF-8') f.writelines(["\n", @@ -217,10 +217,10 @@ def buildNCX(dstdir, title, chapters, chapterNames): filename = getImageFileName(os.path.join(folder, chapter[1])) navID = folder.replace('/', '_').replace('\\', '_') if options.chapters: - title = chapterNames[chapter[1]] + title = chapternames[chapter[1]] navID = filename[0].replace('/', '_').replace('\\', '_') elif os.path.basename(folder) != "Text": - title = chapterNames[os.path.basename(folder)] + title = chapternames[os.path.basename(folder)] f.write("" + escape(title) + "\n") @@ -228,7 +228,7 @@ def buildNCX(dstdir, title, chapters, chapterNames): f.close() -def buildNAV(dstdir, title, chapters, chapterNames): +def buildNAV(dstdir, title, chapters, chapternames): navfile = os.path.join(dstdir, 'OEBPS', 'nav.xhtml') f = open(navfile, "w", encoding='UTF-8') f.writelines(["\n", @@ -245,9 +245,9 @@ def buildNAV(dstdir, title, chapters, chapterNames): folder = chapter[0].replace(os.path.join(dstdir, 'OEBPS'), '').lstrip('/').lstrip('\\\\') filename = getImageFileName(os.path.join(folder, chapter[1])) if options.chapters: - title = chapterNames[chapter[1]] + title = chapternames[chapter[1]] elif os.path.basename(folder) != "Text": - title = chapterNames[os.path.basename(folder)] + title = chapternames[os.path.basename(folder)] f.write("
  • " + escape(title) + "
  • \n") f.writelines(["\n", "\n", @@ -257,9 +257,9 @@ def buildNAV(dstdir, title, chapters, chapterNames): folder = chapter[0].replace(os.path.join(dstdir, 'OEBPS'), '').lstrip('/').lstrip('\\\\') filename = getImageFileName(os.path.join(folder, chapter[1])) if options.chapters: - title = chapterNames[chapter[1]] + title = chapternames[chapter[1]] elif os.path.basename(folder) != "Text": - title = chapterNames[os.path.basename(folder)] + title = chapternames[os.path.basename(folder)] f.write("
  • " + escape(title) + "
  • \n") f.write("\n\n\n") f.close() @@ -348,7 +348,7 @@ def buildOPF(dstdir, title, filelist, cover=None): f.close() -def buildEPUB(path, chapterNames, tomeNumber): +def buildEPUB(path, chapternames, tomenumber): filelist = [] chapterlist = [] cover = None @@ -439,9 +439,9 @@ def buildEPUB(path, chapterNames, tomeNumber): cover = os.path.join(os.path.join(path, 'OEBPS', 'Images'), 'cover' + getImageFileName(filelist[-1][1])[1]) options.covers.append((image.Cover(os.path.join(filelist[-1][0], filelist[-1][1]), cover, options, - tomeNumber), options.uuid)) + tomenumber), options.uuid)) # Overwrite chapternames if tree is flat and ComicInfo.xml has bookmarks - if not chapterNames and options.chapters: + if not chapternames and options.chapters: chapterlist = [] globaldiff = 0 for aChapter in options.chapters: @@ -453,10 +453,10 @@ def buildEPUB(path, chapterNames, tomeNumber): pageid -= 1 filename = filelist[pageid][1] chapterlist.append((filelist[pageid][0].replace('Images', 'Text'), filename)) - chapterNames[filename] = aChapter[1] + chapternames[filename] = aChapter[1] globaldiff = pageid - (aChapter[0] + globaldiff) - buildNCX(path, options.title, chapterlist, chapterNames) - buildNAV(path, options.title, chapterlist, chapterNames) + buildNCX(path, options.title, chapterlist, chapternames) + buildNAV(path, options.title, chapterlist, chapternames) buildOPF(path, options.title, filelist, cover) @@ -542,7 +542,7 @@ def getWorkFolder(afile): copytree(afile, fullPath) sanitizePermissions(fullPath) return workdir - except: + except Exception: rmtree(workdir, True) raise UserWarning("Failed to prepare a workspace.") elif os.path.isfile(afile): @@ -560,7 +560,7 @@ def getWorkFolder(afile): if cbx.isCbxFile(): try: path = cbx.extract(workdir) - except: + except Exception: rmtree(workdir, True) raise UserWarning("Failed to extract archive.") else: @@ -575,7 +575,7 @@ def getWorkFolder(afile): return newpath -def getOutputFilename(srcpath, wantedname, ext, tomeNumber): +def getOutputFilename(srcpath, wantedname, ext, tomenumber): if srcpath[-1] == os.path.sep: srcpath = srcpath[:-1] if 'Ko' in options.profile and options.format == 'EPUB': @@ -589,16 +589,16 @@ def getOutputFilename(srcpath, wantedname, ext, tomeNumber): filename = os.path.join(os.path.abspath(options.output), os.path.basename(os.path.splitext(srcpath)[0]) + ext) elif os.path.isdir(srcpath): - filename = srcpath + tomeNumber + ext + filename = srcpath + tomenumber + ext else: if 'Ko' in options.profile and options.format == 'EPUB': path = srcpath.split(os.path.sep) - path[-1] = ''.join(e for e in path[-1].split('.')[0] if e.isalnum()) + tomeNumber + ext + path[-1] = ''.join(e for e in path[-1].split('.')[0] if e.isalnum()) + tomenumber + ext if not path[-1].split('.')[0]: - path[-1] = 'KCCPlaceholder' + tomeNumber + ext + path[-1] = 'KCCPlaceholder' + tomenumber + ext filename = os.path.sep.join(path) else: - filename = os.path.splitext(srcpath)[0] + tomeNumber + ext + filename = os.path.splitext(srcpath)[0] + tomenumber + ext if os.path.isfile(filename): counter = 0 basename = os.path.splitext(filename)[0] @@ -608,7 +608,7 @@ def getOutputFilename(srcpath, wantedname, ext, tomeNumber): return filename -def getComicInfo(path, originalPath): +def getComicInfo(path, originalpath): xmlPath = os.path.join(path, 'ComicInfo.xml') options.authors = ['KCC'] options.remoteCovers = {} @@ -617,10 +617,10 @@ def getComicInfo(path, originalPath): titleSuffix = '' if options.title == 'defaulttitle': defaultTitle = True - if os.path.isdir(originalPath): - options.title = os.path.basename(originalPath) + if os.path.isdir(originalpath): + options.title = os.path.basename(originalpath) else: - options.title = os.path.splitext(os.path.basename(originalPath))[0] + options.title = os.path.splitext(os.path.basename(originalpath))[0] else: defaultTitle = False if os.path.exists(xmlPath): @@ -655,10 +655,10 @@ def getComicInfo(path, originalPath): os.remove(xmlPath) -def getCoversFromMCB(mangaID): +def getCoversFromMCB(mangaid): covers = {} try: - jsonRaw = urlopen(Request('http://mcd.iosphe.re/api/v1/series/' + mangaID + '/', + jsonRaw = urlopen(Request('http://mcd.iosphe.re/api/v1/series/' + mangaid + '/', headers={'User-Agent': 'KindleComicConverter/' + __version__})) jsonData = loads(jsonRaw.read().decode('utf-8')) for volume in jsonData['Covers']['a']: @@ -683,9 +683,9 @@ def getTopMargin(deviceres, size): return str(round(y, 1)) -def getPanelViewResolution(imageSize, deviceRes): - scale = float(deviceRes[0]) / float(imageSize[0]) - return int(deviceRes[0]), int(scale * imageSize[1]) +def getPanelViewResolution(imagesize, deviceres): + scale = float(deviceres[0]) / float(imagesize[0]) + return int(deviceres[0]), int(scale * imagesize[1]) def getPanelViewSize(deviceres, size): @@ -804,19 +804,19 @@ def splitProcess(path, mode): return output -def detectCorruption(tmpPath, orgPath): +def detectCorruption(tmppath, orgpath): imageNumber = 0 imageSmaller = 0 alreadyProcessed = False - for root, _, files in os.walk(tmpPath, False): + 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'): alreadyProcessed = True path = os.path.join(root, name) - pathOrg = orgPath + path.split('OEBPS' + os.path.sep + 'Images')[1] + pathOrg = orgpath + path.split('OEBPS' + os.path.sep + 'Images')[1] if os.path.getsize(path) == 0: - rmtree(os.path.join(tmpPath, '..', '..'), True) + rmtree(os.path.join(tmppath, '..', '..'), True) raise RuntimeError('Image file %s is corrupted.' % pathOrg) try: img = Image.open(path) @@ -827,7 +827,7 @@ def detectCorruption(tmpPath, orgPath): if options.profileData[1][0] > img.size[0] and options.profileData[1][1] > img.size[1]: imageSmaller += 1 except Exception as err: - rmtree(os.path.join(tmpPath, '..', '..'), True) + rmtree(os.path.join(tmppath, '..', '..'), True) if 'decoder' in str(err) and 'not available' in str(err): raise RuntimeError('Pillow was compiled without JPG and/or PNG decoder.') else: @@ -856,8 +856,8 @@ def createNewTome(): return tomePath, tomePathRoot -def slugify(value, isDir): - if isDir: +def slugify(value, isdir): + if isdir: value = slugifyExt(value, regex_pattern=r'[^-a-z0-9_\.]+') else: value = slugifyExt(value) @@ -865,19 +865,19 @@ def slugify(value, isDir): return value -def makeZIP(zipFilename, baseDir, isEPUB=False): - zipFilename = os.path.abspath(zipFilename) + '.zip' - zipOutput = ZipFile(zipFilename, 'w', ZIP_DEFLATED) - if isEPUB: +def makeZIP(zipfilename, basedir, isepub=False): + zipfilename = os.path.abspath(zipfilename) + '.zip' + zipOutput = ZipFile(zipfilename, 'w', ZIP_DEFLATED) + if isepub: zipOutput.writestr('mimetype', 'application/epub+zip', ZIP_STORED) - for dirpath, _, filenames in os.walk(baseDir): + for dirpath, _, filenames in os.walk(basedir): for name in filenames: path = os.path.normpath(os.path.join(dirpath, name)) - aPath = os.path.normpath(os.path.join(dirpath.replace(baseDir, ''), name)) + aPath = os.path.normpath(os.path.join(dirpath.replace(basedir, ''), name)) if os.path.isfile(path): zipOutput.write(path, aPath) zipOutput.close() - return zipFilename + return zipfilename def makeParser(): @@ -1039,13 +1039,13 @@ def checkPre(source): try: with TemporaryFile(prefix='KCC-', dir=src): pass - except: + except Exception: raise UserWarning("Target directory is not writable.") -def makeBook(source, qtGUI=None): +def makeBook(source, qtgui=None): global GUI - GUI = qtGUI + GUI = qtgui if GUI: GUI.progressBarTick.emit('1') else: @@ -1061,7 +1061,7 @@ def makeBook(source, qtGUI=None): y = 1024 else: y = image.ProfileData.Profiles[options.profile][1][1] - comic2panel.main(['-y ' + str(y), '-i', '-m', path], qtGUI) + comic2panel.main(['-y ' + str(y), '-i', '-m', path], qtgui) print("Processing images...") if GUI: GUI.progressBarTick.emit('Processing images') @@ -1192,9 +1192,9 @@ def makeMOBIWorker(item): return [kindlegenErrorCode, kindlegenError, item] -def makeMOBI(work, qtGUI=None): +def makeMOBI(work, qtgui=None): global GUI, makeMOBIWorkerPool, makeMOBIWorkerOutput - GUI = qtGUI + GUI = qtgui makeMOBIWorkerOutput = [] availableMemory = virtual_memory().total / 1000000000 if availableMemory <= 2: diff --git a/kindlecomicconverter/comic2panel.py b/kindlecomicconverter/comic2panel.py index 14b32947..03093e07 100644 --- a/kindlecomicconverter/comic2panel.py +++ b/kindlecomicconverter/comic2panel.py @@ -93,6 +93,7 @@ def splitImageTick(output): splitWorkerPool.terminate() +# noinspection PyUnboundLocalVariable def splitImage(work): try: path = work[0] @@ -140,9 +141,7 @@ def splitImage(work): if opt.debug: for panel in panelsProcessed: - # noinspection PyUnboundLocalVariable draw.rectangle([(0, panel[0]), (widthImg, panel[1])], (0, 255, 0, 128), (0, 0, 255, 255)) - # noinspection PyUnboundLocalVariable debugImage = Image.alpha_composite(imgOrg.convert(mode='RGBA'), drawImg) debugImage.save(os.path.join(path, os.path.splitext(name)[0] + '-debug.png'), 'PNG') @@ -185,7 +184,7 @@ def splitImage(work): return str(sys.exc_info()[1]), sanitizeTrace(sys.exc_info()[2]) -def main(argv=None, qtGUI=None): +def main(argv=None, qtgui=None): global options, GUI, splitWorkerPool, splitWorkerOutput, mergeWorkerPool, mergeWorkerOutput parser = OptionParser(usage="Usage: kcc-c2p [options] comic_folder", add_help_option=False) mainOptions = OptionGroup(parser, "MANDATORY") @@ -203,8 +202,8 @@ def main(argv=None, qtGUI=None): parser.add_option_group(mainOptions) parser.add_option_group(otherOptions) options, args = parser.parse_args(argv) - if qtGUI: - GUI = qtGUI + if qtgui: + GUI = qtgui else: GUI = None if len(args) != 1: diff --git a/kindlecomicconverter/image.py b/kindlecomicconverter/image.py index e7f29a43..fdb2ed47 100755 --- a/kindlecomicconverter/image.py +++ b/kindlecomicconverter/image.py @@ -299,53 +299,53 @@ def resizeImage(self): if self.image.size[0] > self.size[0] or self.image.size[1] > self.size[1]: self.image.thumbnail(self.size, Image.LANCZOS) - def getBoundingBox(self, tmpImg): - min_margin = [int(0.005 * i + 0.5) for i in tmpImg.size] - max_margin = [int(0.1 * i + 0.5) for i in tmpImg.size] - bbox = tmpImg.getbbox() + def getBoundingBox(self, tmptmg): + min_margin = [int(0.005 * i + 0.5) for i in tmptmg.size] + max_margin = [int(0.1 * i + 0.5) for i in tmptmg.size] + bbox = tmptmg.getbbox() bbox = ( max(0, min(max_margin[0], bbox[0] - min_margin[0])), max(0, min(max_margin[1], bbox[1] - min_margin[1])), - min(tmpImg.size[0], - max(tmpImg.size[0] - max_margin[0], bbox[2] + min_margin[0])), - min(tmpImg.size[1], - max(tmpImg.size[1] - max_margin[1], bbox[3] + min_margin[1])), + min(tmptmg.size[0], + max(tmptmg.size[0] - max_margin[0], bbox[2] + min_margin[0])), + min(tmptmg.size[1], + max(tmptmg.size[1] - max_margin[1], bbox[3] + min_margin[1])), ) return bbox def cropPageNumber(self, power): if self.fill != 'white': - tmpImg = self.image.convert(mode='L') + tmptmg = self.image.convert(mode='L') else: - tmpImg = ImageOps.invert(self.image.convert(mode='L')) - tmpImg = tmpImg.point(lambda x: x and 255) - tmpImg = tmpImg.filter(ImageFilter.MinFilter(size=3)) - tmpImg = tmpImg.filter(ImageFilter.GaussianBlur(radius=5)) - tmpImg = tmpImg.point(lambda x: (x >= 16 * power) and x) - self.image = self.image.crop(tmpImg.getbbox()) if tmpImg.getbbox() else self.image + tmptmg = ImageOps.invert(self.image.convert(mode='L')) + tmptmg = tmptmg.point(lambda x: x and 255) + tmptmg = tmptmg.filter(ImageFilter.MinFilter(size=3)) + tmptmg = tmptmg.filter(ImageFilter.GaussianBlur(radius=5)) + tmptmg = tmptmg.point(lambda x: (x >= 16 * power) and x) + self.image = self.image.crop(tmptmg.getbbox()) if tmptmg.getbbox() else self.image def cropMargin(self, power): if self.fill != 'white': - tmpImg = self.image.convert(mode='L') + tmptmg = self.image.convert(mode='L') else: - tmpImg = ImageOps.invert(self.image.convert(mode='L')) - tmpImg = tmpImg.filter(ImageFilter.GaussianBlur(radius=3)) - tmpImg = tmpImg.point(lambda x: (x >= 16 * power) and x) - self.image = self.image.crop(self.getBoundingBox(tmpImg)) if tmpImg.getbbox() else self.image + tmptmg = ImageOps.invert(self.image.convert(mode='L')) + tmptmg = tmptmg.filter(ImageFilter.GaussianBlur(radius=3)) + tmptmg = tmptmg.point(lambda x: (x >= 16 * power) and x) + self.image = self.image.crop(self.getBoundingBox(tmptmg)) if tmptmg.getbbox() else self.image class Cover: - def __init__(self, source, target, opt, tomeNumber): + def __init__(self, source, target, opt, tomeid): self.options = opt self.source = source self.target = target - if tomeNumber == 0: - self.tomeNumber = 1 + if tomeid == 0: + self.tomeid = 1 else: - self.tomeNumber = tomeNumber - if self.tomeNumber in self.options.remoteCovers: + self.tomeid = tomeid + if self.tomeid in self.options.remoteCovers: try: - source = urlopen(Request(quote(self.options.remoteCovers[self.tomeNumber]).replace('%3A', ':', 1), + source = urlopen(Request(quote(self.options.remoteCovers[self.tomeid]).replace('%3A', ':', 1), headers={'User-Agent': 'KindleComicConverter/' + __version__})).read() self.image = Image.open(BytesIO(source)) except Exception: diff --git a/kindlecomicconverter/pdfjpgextract.py b/kindlecomicconverter/pdfjpgextract.py index 90d06439..0889edaa 100644 --- a/kindlecomicconverter/pdfjpgextract.py +++ b/kindlecomicconverter/pdfjpgextract.py @@ -25,17 +25,16 @@ class PdfJpgExtract: - def __init__(self, origFileName): - self.origFileName = origFileName - self.filename = os.path.splitext(origFileName) - # noinspection PyUnusedLocal - self.path = self.filename[0] + "-KCC-" + ''.join(choice(ascii_uppercase + digits) for x in range(3)) + def __init__(self, fname): + self.fname = fname + self.filename = os.path.splitext(fname) + self.path = self.filename[0] + "-KCC-" + ''.join(choice(ascii_uppercase + digits) for _ in range(3)) def getPath(self): return self.path def extract(self): - pdf = open(self.origFileName, "rb").read() + pdf = open(self.fname, "rb").read() startmark = b"\xff\xd8" startfix = 0 endmark = b"\xff\xd9" diff --git a/kindlecomicconverter/shared.py b/kindlecomicconverter/shared.py index c2a8ecf4..6f3a0aaf 100644 --- a/kindlecomicconverter/shared.py +++ b/kindlecomicconverter/shared.py @@ -73,8 +73,8 @@ def walkLevel(some_dir, level=1): del dirs[:] -def md5Checksum(filePath): - with open(filePath, 'rb') as fh: +def md5Checksum(fpath): + with open(fpath, 'rb') as fh: m = md5() while True: data = fh.read(8192) @@ -84,8 +84,8 @@ def md5Checksum(filePath): return m.hexdigest() -def check7ZFile(filePath): - with open(filePath, 'rb') as fh: +def check7ZFile(fpath): + with open(fpath, 'rb') as fh: header = fh.read(6) return header == b"7z\xbc\xaf'\x1c" From 829a5f25e793ac8db8ffdb04380d73f7d16d7095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Fri, 3 Nov 2017 19:23:41 +0100 Subject: [PATCH 2/6] Experimental KFX output --- kindlecomicconverter/comic2ebook.py | 199 +++++++++++++++++----------- kindlecomicconverter/image.py | 6 +- 2 files changed, 126 insertions(+), 79 deletions(-) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 1689d8d6..ffff62f9 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -88,7 +88,7 @@ def buildHTML(path, imgfile, imgfilepath): if "BlackBackground" in options.imgMetadata[imgfilepath]: additionalStyle = 'background-color:#000000;' else: - additionalStyle = 'background-color:#FFFFFF;' + additionalStyle = '' postfix = '' backref = 1 head = path @@ -287,20 +287,27 @@ def buildOPF(dstdir, title, filelist, cover=None): for author in options.authors: f.writelines(["", author, "\n"]) f.writelines(["" + strftime("%Y-%m-%dT%H:%M:%SZ", gmtime()) + "\n", - "\n", - "portrait\n", - "portrait\n", - "pre-paginated\n"]) + "\n"]) if options.iskindle and options.profile != 'Custom': - f.writelines(["\n", + "\n", "\n", - "\n", "\n", "\n", "\n", - "\n", + "\n", "\n"]) + if options.kfx: + f.writelines(["\n", + "\n"]) + else: + f.writelines(["\n", + "\n"]) + else: + f.writelines(["portrait\n", + "portrait\n", + "pre-paginated\n"]) f.writelines(["\n\n\n", "\n") if options.righttoleft: f.write("\n\n") + pageside = "right" else: f.write("\n\n") - for entry in reflist: - f.write("\n") + pageside = "left" + if options.iskindle: + for entry in reflist: + if options.righttoleft: + if entry.endswith("-b"): + f.write("\n") + pageside = "right" + elif entry.endswith("-c"): + f.write("\n") + pageside = "right" + else: + f.write("\n") + if pageside == "right": + pageside = "left" + else: + pageside = "right" + else: + if entry.endswith("-b"): + f.write("\n") + pageside = "left" + elif entry.endswith("-c"): + f.write("\n") + pageside = "left" + else: + f.write("\n") + if pageside == "right": + pageside = "left" + else: + pageside = "right" + else: + for entry in reflist: + f.write("\n") f.write("\n\n") f.close() os.mkdir(os.path.join(dstdir, 'META-INF')) @@ -361,71 +401,72 @@ def buildEPUB(path, chapternames, tomenumber): "display: block;\n", "margin: 0;\n", "padding: 0;\n", - "}\n", - "#PV {\n", - "position: absolute;\n", - "width: 100%;\n", - "height: 100%;\n", - "top: 0;\n", - "left: 0;\n", - "}\n", - "#PV-T {\n", - "top: 0;\n", - "width: 100%;\n", - "height: 50%;\n", - "}\n", - "#PV-B {\n", - "bottom: 0;\n", - "width: 100%;\n", - "height: 50%;\n", - "}\n", - "#PV-L {\n", - "left: 0;\n", - "width: 49.5%;\n", - "height: 100%;\n", - "float: left;\n", - "}\n", - "#PV-R {\n", - "right: 0;\n", - "width: 49.5%;\n", - "height: 100%;\n", - "float: right;\n", - "}\n", - "#PV-TL {\n", - "top: 0;\n", - "left: 0;\n", - "width: 49.5%;\n", - "height: 50%;\n", - "float: left;\n", - "}\n", - "#PV-TR {\n", - "top: 0;\n", - "right: 0;\n", - "width: 49.5%;\n", - "height: 50%;\n", - "float: right;\n", - "}\n", - "#PV-BL {\n", - "bottom: 0;\n", - "left: 0;\n", - "width: 49.5%;\n", - "height: 50%;\n", - "float: left;\n", - "}\n", - "#PV-BR {\n", - "bottom: 0;\n", - "right: 0;\n", - "width: 49.5%;\n", - "height: 50%;\n", - "float: right;\n", - "}\n", - ".PV-P {\n", - "width: 100%;\n", - "height: 100%;\n", - "top: 0;\n", - "position: absolute;\n", - "display: none;\n", "}\n"]) + if options.iskindle and options.panelview: + f.writelines(["#PV {\n", + "position: absolute;\n", + "width: 100%;\n", + "height: 100%;\n", + "top: 0;\n", + "left: 0;\n", + "}\n", + "#PV-T {\n", + "top: 0;\n", + "width: 100%;\n", + "height: 50%;\n", + "}\n", + "#PV-B {\n", + "bottom: 0;\n", + "width: 100%;\n", + "height: 50%;\n", + "}\n", + "#PV-L {\n", + "left: 0;\n", + "width: 49.5%;\n", + "height: 100%;\n", + "float: left;\n", + "}\n", + "#PV-R {\n", + "right: 0;\n", + "width: 49.5%;\n", + "height: 100%;\n", + "float: right;\n", + "}\n", + "#PV-TL {\n", + "top: 0;\n", + "left: 0;\n", + "width: 49.5%;\n", + "height: 50%;\n", + "float: left;\n", + "}\n", + "#PV-TR {\n", + "top: 0;\n", + "right: 0;\n", + "width: 49.5%;\n", + "height: 50%;\n", + "float: right;\n", + "}\n", + "#PV-BL {\n", + "bottom: 0;\n", + "left: 0;\n", + "width: 49.5%;\n", + "height: 50%;\n", + "float: left;\n", + "}\n", + "#PV-BR {\n", + "bottom: 0;\n", + "right: 0;\n", + "width: 49.5%;\n", + "height: 50%;\n", + "float: right;\n", + "}\n", + ".PV-P {\n", + "width: 100%;\n", + "height: 100%;\n", + "top: 0;\n", + "position: absolute;\n", + "display: none;\n", + "}\n"]) f.close() for dirpath, dirnames, filenames in os.walk(os.path.join(path, 'OEBPS', 'Images')): chapter = False @@ -906,7 +947,7 @@ def makeParser(): outputOptions.add_option("-t", "--title", action="store", dest="title", default="defaulttitle", help="Comic title [Default=filename or directory name]") outputOptions.add_option("-f", "--format", action="store", dest="format", default="Auto", - help="Output format (Available options: Auto, MOBI, EPUB, CBZ) [Default=Auto]") + help="Output format (Available options: Auto, MOBI, EPUB, CBZ, KFX) [Default=Auto]") outputOptions.add_option("-b", "--batchsplit", type="int", dest="batchsplit", default="0", help="Split output into multiple files. 0: Don't split 1: Automatic mode " "2: Consider every subdirectory as separate volume [Default=0]") @@ -953,6 +994,7 @@ def checkOptions(): options.panelview = True options.iskindle = False options.bordersColor = None + options.kfx = False if options.format == 'Auto': if options.profile in ['K1', 'K2', 'K34', 'K578', 'KPW', 'KV', 'KO']: options.format = 'MOBI' @@ -967,7 +1009,7 @@ def checkOptions(): if options.black_borders: options.bordersColor = 'black' # Splitting MOBI is not optional - if options.format == 'MOBI' and options.batchsplit != 2: + if (options.format == 'MOBI' or options.format == 'KFX') and options.batchsplit != 2: options.batchsplit = 1 # Older Kindle models don't support Panel View. if options.profile == 'K1' or options.profile == 'K2' or options.profile == 'K34' or options.profile == 'KDX': @@ -989,6 +1031,11 @@ def checkOptions(): # CBZ files on Kindle DX/DXG support higher resolution if options.profile == 'KDX' and options.format == 'CBZ': options.customheight = 1200 + # KFX output create EPUB that might be can be by jhowell KFX Output Calibre plugin + if options.format == 'KFX': + options.format = 'EPUB' + options.kfx = True + options.panelview = False # Override profile data if options.customwidth != 0 or options.customheight != 0: X = image.ProfileData.Profiles[options.profile][1][0] diff --git a/kindlecomicconverter/image.py b/kindlecomicconverter/image.py index fdb2ed47..21a486fe 100755 --- a/kindlecomicconverter/image.py +++ b/kindlecomicconverter/image.py @@ -273,17 +273,17 @@ def resizeImage(self): method = Image.BICUBIC else: method = Image.LANCZOS - if self.opt.stretch: + if self.opt.stretch or (self.opt.kfx and ('-KCC-B' in self.targetPath or '-KCC-C' in self.targetPath)): self.image = self.image.resize(self.size, method) elif self.image.size[0] <= self.size[0] and self.image.size[1] <= self.size[1] and not self.opt.upscale: - if self.opt.format == 'CBZ': + if self.opt.format == 'CBZ' or self.opt.kfx: borderw = int((self.size[0] - self.image.size[0]) / 2) borderh = int((self.size[1] - self.image.size[1]) / 2) self.image = ImageOps.expand(self.image, border=(borderw, borderh), fill=self.fill) if self.image.size[0] != self.size[0] or self.image.size[1] != self.size[1]: self.image = ImageOps.fit(self.image, self.size, method=Image.BICUBIC, centering=(0.5, 0.5)) else: - if self.opt.format == 'CBZ': + if self.opt.format == 'CBZ' or self.opt.kfx: ratioDev = float(self.size[0]) / float(self.size[1]) if (float(self.image.size[0]) / float(self.image.size[1])) < ratioDev: diff = int(self.image.size[1] * ratioDev) - self.image.size[0] From ac81a6be4b646dcf519fea9e9450f2120733ec36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Fri, 10 Nov 2017 17:32:34 +0100 Subject: [PATCH 3/6] Fixed dot processing in directory names --- kindlecomicconverter/comic2ebook.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index ffff62f9..8714fcfa 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -900,6 +900,7 @@ def createNewTome(): def slugify(value, isdir): if isdir: value = slugifyExt(value, regex_pattern=r'[^-a-z0-9_\.]+') + value = value.rstrip('.') else: value = slugifyExt(value) value = sub(r'0*([0-9]{4,})', r'\1', sub(r'([0-9]+)', r'0000\1', value, count=2)) From 6acf1a180223f34ee55e9d75787972ff982f70c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Fri, 10 Nov 2017 19:10:23 +0100 Subject: [PATCH 4/6] Updated build enviroment --- .gitignore | 7 +++---- appveyor.yml | 4 +--- other/windows/Cert.pfx.enc | Bin 3520 -> 0 bytes setup.bat | 4 ---- setup.py | 4 ---- 5 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 other/windows/Cert.pfx.enc delete mode 100644 setup.bat diff --git a/.gitignore b/.gitignore index 6b1ecfed..6877d7a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,15 @@ *.pyc *.cbz *.cbr +*.spec .idea .DS_Store +.python-version Thumbs.db dist Output -test -solaio kindlegen* -*.spec +setup.bat kindlecomicconverter/sentry.py build/ -.python-version KindleComicConverter.egg-info/ diff --git a/appveyor.yml b/appveyor.yml index 1fb13e10..44cd72b9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,15 +7,13 @@ install: - "%PYTHON%\\python.exe -m pip install -r requirements.txt" - "%PYTHON%\\python.exe -m pip install certifi PyInstaller" - nuget install secure-file -ExcludeVersion - - nuget install verpatch -ExcludeVersion - - secure-file\tools\secure-file -decrypt other\windows\Cert.pfx.enc -secret %ENCRYPTION% - secure-file\tools\secure-file -decrypt other\windows\sentry.py.enc -out kindlecomicconverter\sentry.py -secret %ENCRYPTION% build_script: - "%PYTHON%\\python.exe setup.py build_binary" after_build: - - ps: Get-ChildItem .\dist\KindleComicConverter_win_* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } + - ps: Get-ChildItem .\dist\KCC* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } deploy: provider: S3 diff --git a/other/windows/Cert.pfx.enc b/other/windows/Cert.pfx.enc deleted file mode 100644 index 147cb9712169dabd0945156e64020debf3099d9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3520 zcmV;x4L|b1AzQ0RS?2I(2muDbB*a;7Q+-3Df0r_$XW(roVrxi2F=hkc1D%ndRKNBe z3sRL`#HT2>%DLV-$#xDHnk~)5;W`v8zV7B z-?I*22#c=jeC{>XS3fc3T#LHUD*lZsCB!wt56M*rM{0HDSaW0fKzj5JlCLFYFP3$)kWDNxFjW*)QFLZtLox^mcEIa!)Mk4=J}>TRz1Lo)-27;jIQ? zdB0y4@}Tps_ltI014ZZWA0HKIAo_}Ne0%R%*WmCza1Jj`&jJc7B-=D~XR%_MVwQF+ z`vCT9XJ_sHWHhU?G`YM%M56TH7djv0eHJ_m8fIRIXd&F8Oh;jT{9P`*jT6&wq%l@5>1zjX2 zRD;m$B=(Q~aymKNQw6nVr$fh@A%${Qr>O|KPgeE^M-PV6L>(($?dwbDFO2`_vwcQV z){vw%hhEte#$^Og*{+n0M@JF(DO-@1*t=0rIx(w*kFx?K7>h<_`R0k&oB!jPwh!_^ zphtN+E8?!yt*llTCiK;KrSeo5gyDq`*l`^@(dAn0=b_E`O7CIn3Xy|iP3kAZueZ_-T%zP3li63#tv-JdohOImx;59H;_+zrd#E1nyW zj^9$A#Bs>fQm8o2$O%^xVDXaNBKO-eS%={crCYya7UZV~m0xEQh?h3ZDf0Ag#kCFr zGq*J5p>n(Jk$ac5h2ONF(VjEN!v1&W_fm~w(!J(l;mCjT$eaOjg3U1n=)!qBYb7ZS zLMj4*XFbeWJ)PQ|=UxysAjSw9#(f8*FBw!2?AbjbrAXUk63o6U<+xv^~(abHqx3s{0nt&gjFiCP^>>MQHDO&2Xl>|Z&0yotZMuXy)@ z9OM?sZ2lgwqjW%I(n}00<4DV&SPGn-n9aHaY`)&gO3ECPJU|eEN9&CGaJ}znpz0Pi zUZC}{=l#q#CR|E_E6soto^e$z_-_%Q%>>k`inD)E%8eJb$;dmjMduShw)yv2mr-1d zv=SJu(RWarNh}936|;!u1!D?_ zGd?h%mGg|UHA0bK0@%RJX=j zdQW;vY_K{&mLFac^aTm%c*3!XX*fNk=4?Mjr~%n=&kjWoWebCBcYDq_5~UP8VQ&{%x{Fo4RrlBl=9(>PjR zeg0%4q9uW;OXj3Gw0%p4L;MuJ-N*xlvzc{Cl0uB(Y{#nV+Y@m`Pab>78!`Fdxv;|& zN`Km&u5evESH(DhV|!?Q+JZn&!bH>*GPKN-)qfRP$A1Uq?_;J&W!g&Y)n*enKD!jfW718^{d+Tr-KZr zQGQt9@7~5Jcz7sDvM(puqb@GV5)3Trpl1~a)<2Sc5#HQ)!qv00$uV`^^iIzvzYw}x zT$u1|Y+fV7KT;#*4*$8|mLxwzF7{_-Uvg3)u$Yx~?AhLRU-t-c57P=JJ7y9n+Otu? zPM%^{eWj|47Uqnw>8$8U3w29eBS+lSZacGmX!F-b7{`?9?xfUN1nM`Ug!Sv2xK#M=UiNROTj!RaQ{^V8#R`@9p z`I`X_bH7lVXy;EooCo;Z6+P?n=m^BChjhzAGl%<(I>bR|pS4ag-WH!c$62-#ft^Z1 zLAJ=fz?#un3^5RZV}@?5Xe}NWu3>lbjC^77CbeZz8p85CyhL%ukl`Mnd3_~>b24P} zQL>dZT5vt`I$KQ#@Vi1=V>^O)`P(#D{pEy~wn<|X`xw-xyhmjWx;<0|9ViJD=dRv3 zN9M5v#>@er{NQ3)9n$RA1vASiqav)Jq5QmYeTAbKN3*kb-FDi_+A!p(ODF6zGU>#n zV3yo0lZTbCTzy*jSxeB_;!u&&7EGi67vEW`VG5P|e#Z+yx#{$@N`42Ua2Da+SU}1O zqLE7)te@-@tHyUddmU!?8$@vltDvP1({1yVXdeol?sHkzqUr|p5X+UZQ>GySTgI|G zGNUky-(#A~+sb3=(MS?nY^-g7-o+Bl#;SKhk-T#KD?zxE;$p}cuF)-+wX`9J!Q9_t zK*l3BOc;jabf*-{T2jYF_;#D8zPUU^Rj#U2xrS-hGXH}44NwE*JxIAHK;#pL8ZMYT zw~H|C66zM)f-mqwX-Y&5ANTm2k5Pm_%@*CLmo7kO4Fv?q*hG^kqekjM6E{=F*%(MQ z7fRkNGa;QrecQl8_vEbu{b7{QlvLCw6pkbMvmKiEtG{v0A(#+sO)Z&}An9>-ESExh z7#_x=CCh{gkDH}p6)W+SfO5iA;E{#Q%PM? zt%sP3iTReN_<}Hm4J^v4mV!f$hPf4oUtdF|8oFwaX|_%Pq%}e)FU!5&Gx0(g3-ywcltI?y1U@+>YL}~VbDr#`)6CC_ zo{3^TU~(&ZErX0+i{?*mVzwFV^u6&9zf_Gsau&;#jkY<>YM=F)`1M2G?MY7sSM%Fa z7j)47n_nGoA;aRGBID?F^ULKY`!-s;h{hqZIykfedQvViZyG(-;(@;WQuW+4t^o*2 zmY-*P(GEtqU?e!r*bFD?is9aJx-r?T?2r;*!fo{;8lPiAg8K>NWl3OLlHslsLkIr% zxNyj#Az4!4{qTDZXj4XxfREYd8Y*p`y-w&cI5K50Ac+aAWGY`f+W1GWEWJ*KiLA-c zt+3XIiIc9yruYOpr zaWo(_>l;DM3G!!zEtZ6s{zY7@CGI6!mEh8=(aSs%SnMNPMxS5%?*b;^ zvDnyY*=#MVKy8isH(_P@TSQn4(32v}i~SP$-YHAqO0dGdR3}BYcqi~eMqADmV%gb| zqcT>nN_nVnvp506y~{Xm*%l&)3G3y4QMWH$Dj~eA_W*Qtqtj_OfbHgIwhd}me`5;< z>Lu3RH-4Ydm(GXx!YQX2IKL}`%*`UwM57Fj!uMiFk{m@Z%apZeM0kY(7$NzNp~wf^ zA?ARy=zc2g?8<yW5;_(I#s4^t8n&Jg8SYP-R4fP*sJ}Bvb5zR8?Rd}!a4?JY2S(I z&OdV^!m@qTy*W)_$y;UTfzIVxq5=65{5oPY#g=xSnv5=e%Pe2JZlZGf?ie|r%gU~| zk}{-2oqGbyye3(*CUqaEnul 2>&1 diff --git a/setup.py b/setup.py index c50dcaa0..50287049 100755 --- a/setup.py +++ b/setup.py @@ -47,10 +47,6 @@ def run(self): exit(0) elif sys.platform == 'win32': os.system('pyinstaller -y -F -i icons\comic2ebook.ico -n KCC -w --noupx kcc.py') - if os.getenv('APPVEYOR'): - if len(VERSION) == 3: - VERSION = VERSION + '.0' - os.system('setup.bat ' + VERSION) exit(0) else: os.system('pyinstaller -y -F kcc.py') From fe554c20aa04ef97dac8031dcd82b654a8f147ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Fri, 10 Nov 2017 19:54:07 +0100 Subject: [PATCH 5/6] Fixed dot procesing for real this time --- kindlecomicconverter/comic2ebook.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 8714fcfa..f97f2903 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -899,10 +899,9 @@ def createNewTome(): def slugify(value, isdir): if isdir: - value = slugifyExt(value, regex_pattern=r'[^-a-z0-9_\.]+') - value = value.rstrip('.') + value = slugifyExt(value, regex_pattern=r'[^-a-z0-9_\.]+').strip('.') else: - value = slugifyExt(value) + value = slugifyExt(value).strip('.') value = sub(r'0*([0-9]{4,})', r'\1', sub(r'([0-9]+)', r'0000\1', value, count=2)) return value From 5ecddaceab4c74716f9467c01065f1934351ad6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Thu, 8 Mar 2018 16:12:56 +0100 Subject: [PATCH 6/6] Version bump --- CHANGELOG.md | 3 +++ LICENSE.txt | 2 +- README.md | 2 +- kcc-c2e.py | 2 +- kcc-c2p.py | 2 +- kcc.iss | 4 ++-- kcc.py | 2 +- kindlecomicconverter/KCC_gui.py | 2 +- kindlecomicconverter/__init__.py | 4 ++-- kindlecomicconverter/cbxarchive.py | 2 +- kindlecomicconverter/comic2ebook.py | 2 +- kindlecomicconverter/comic2panel.py | 2 +- kindlecomicconverter/dualmetafix.py | 2 +- kindlecomicconverter/image.py | 2 +- kindlecomicconverter/kindle.py | 2 +- kindlecomicconverter/metadata.py | 2 +- kindlecomicconverter/pdfjpgextract.py | 2 +- kindlecomicconverter/shared.py | 2 +- kindlecomicconverter/startup.py | 2 +- other/osx/Info.plist | 6 +++--- 20 files changed, 26 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 759b6ff8..e1b992dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # CHANGELOG +#### 5.4.4: +* Minor bug fixes + #### 5.4.3: * Fixed conversion crash on Windows diff --git a/LICENSE.txt b/LICENSE.txt index 5d0945ea..a060b54f 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,7 +1,7 @@ ISC LICENSE Copyright (c) 2012-2014 Ciro Mattia Gonano -Copyright (c) 2013-2017 Paweł Jastrzębski +Copyright (c) 2013-2018 Paweł Jastrzębski Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the diff --git a/README.md b/README.md index fe49da19..8aae836d 100644 --- a/README.md +++ b/README.md @@ -181,5 +181,5 @@ The app relies and includes the following scripts: Please check [wiki page](https://github.com/ciromattia/kcc/wiki/Known-issues). ## COPYRIGHT -Copyright (c) 2012-2017 Ciro Mattia Gonano and Paweł Jastrzębski. +Copyright (c) 2012-2018 Ciro Mattia Gonano and Paweł Jastrzębski. **KCC** is released under ISC LICENSE; see LICENSE.txt for further details. diff --git a/kcc-c2e.py b/kcc-c2e.py index c17deeca..24005609 100755 --- a/kcc-c2e.py +++ b/kcc-c2e.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/kcc-c2p.py b/kcc-c2p.py index fca94fcd..4d5b1e1e 100755 --- a/kcc-c2p.py +++ b/kcc-c2p.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/kcc.iss b/kcc.iss index 28c54a43..40eca0d6 100644 --- a/kcc.iss +++ b/kcc.iss @@ -1,5 +1,5 @@ #define MyAppName "Kindle Comic Converter" -#define MyAppVersion "5.4.3" +#define MyAppVersion "5.4.4" #define MyAppPublisher "Ciro Mattia Gonano, Paweł Jastrzębski" #define MyAppURL "http://kcc.iosphe.re/" #define MyAppExeName "KCC.exe" @@ -12,7 +12,7 @@ AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} -AppCopyright=Copyright (C) 2012-2017 Ciro Mattia Gonano and Paweł Jastrzębski +AppCopyright=Copyright (C) 2012-2018 Ciro Mattia Gonano and Paweł Jastrzębski ArchitecturesAllowed=x64 DefaultDirName={pf}\{#MyAppName} DefaultGroupName={#MyAppName} diff --git a/kcc.py b/kcc.py index a6020d9e..347a4ac5 100755 --- a/kcc.py +++ b/kcc.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index 651026a8..71e06de1 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/kindlecomicconverter/__init__.py b/kindlecomicconverter/__init__.py index cdb3623d..8cb3badf 100644 --- a/kindlecomicconverter/__init__.py +++ b/kindlecomicconverter/__init__.py @@ -1,4 +1,4 @@ -__version__ = '5.4.3' +__version__ = '5.4.4' __license__ = 'ISC' -__copyright__ = '2012-2017, Ciro Mattia Gonano , Pawel Jastrzebski ' +__copyright__ = '2012-2018, Ciro Mattia Gonano , Pawel Jastrzebski ' __docformat__ = 'restructuredtext en' diff --git a/kindlecomicconverter/cbxarchive.py b/kindlecomicconverter/cbxarchive.py index fdb63938..40ce9289 100644 --- a/kindlecomicconverter/cbxarchive.py +++ b/kindlecomicconverter/cbxarchive.py @@ -1,5 +1,5 @@ # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index f97f2903..7aaf0272 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/kindlecomicconverter/comic2panel.py b/kindlecomicconverter/comic2panel.py index 03093e07..c3d9e1ce 100644 --- a/kindlecomicconverter/comic2panel.py +++ b/kindlecomicconverter/comic2panel.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/kindlecomicconverter/dualmetafix.py b/kindlecomicconverter/dualmetafix.py index 566ceb5f..e6be2557 100644 --- a/kindlecomicconverter/dualmetafix.py +++ b/kindlecomicconverter/dualmetafix.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Based on initial version of DualMetaFix. Copyright (C) 2013 Kevin Hendricks -# Changes for KCC Copyright (C) 2014-2017 Pawel Jastrzebski +# Changes for KCC Copyright (C) 2014-2018 Pawel Jastrzebski # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/kindlecomicconverter/image.py b/kindlecomicconverter/image.py index 21a486fe..d7c05ec4 100755 --- a/kindlecomicconverter/image.py +++ b/kindlecomicconverter/image.py @@ -2,7 +2,7 @@ # Copyright (C) 2011 Stanislav (proDOOMman) Kosolapov # Copyright (c) 2016 Alberto Planas # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/kindlecomicconverter/kindle.py b/kindlecomicconverter/kindle.py index 1eea63ca..f9595f6f 100644 --- a/kindlecomicconverter/kindle.py +++ b/kindlecomicconverter/kindle.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/kindlecomicconverter/metadata.py b/kindlecomicconverter/metadata.py index 714dcd18..da16718a 100644 --- a/kindlecomicconverter/metadata.py +++ b/kindlecomicconverter/metadata.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/kindlecomicconverter/pdfjpgextract.py b/kindlecomicconverter/pdfjpgextract.py index 0889edaa..250cf35a 100644 --- a/kindlecomicconverter/pdfjpgextract.py +++ b/kindlecomicconverter/pdfjpgextract.py @@ -1,5 +1,5 @@ # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Based upon the code snippet by Ned Batchelder # (http://nedbatchelder.com/blog/200712/extracting_jpgs_from_pdfs.html) diff --git a/kindlecomicconverter/shared.py b/kindlecomicconverter/shared.py index 6f3a0aaf..67786212 100644 --- a/kindlecomicconverter/shared.py +++ b/kindlecomicconverter/shared.py @@ -1,5 +1,5 @@ # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/kindlecomicconverter/startup.py b/kindlecomicconverter/startup.py index aa78a0a5..deb6313a 100644 --- a/kindlecomicconverter/startup.py +++ b/kindlecomicconverter/startup.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2012-2014 Ciro Mattia Gonano -# Copyright (c) 2013-2017 Pawel Jastrzebski +# Copyright (c) 2013-2018 Pawel Jastrzebski # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the diff --git a/other/osx/Info.plist b/other/osx/Info.plist index 1c50fa5c..9ae04ea2 100644 --- a/other/osx/Info.plist +++ b/other/osx/Info.plist @@ -30,7 +30,7 @@ CFBundleExecutable MacOS/Kindle Comic Converter CFBundleGetInfoString - KindleComicConverter 5.4.3, written 2012-2017 by Ciro Mattia Gonano and Pawel Jastrzebski + KindleComicConverter 5.4.4, written 2012-2018 by Ciro Mattia Gonano and Pawel Jastrzebski CFBundleIconFile comic2ebook.icns CFBundleIdentifier @@ -42,11 +42,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.4.3 + 5.4.4 CFBundleSignature ???? CFBundleVersion - 5.4.3 + 5.4.4 LSEnvironment PATH