From 21174338ffb1f2e60225fb4c3d1853a16928e20a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 3 Nov 2015 18:15:32 +0100 Subject: [PATCH 1/5] Fixed Panel View placement --- kcc/comic2ebook.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 69ea6b5e..7ebde845 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -182,15 +182,16 @@ def buildHTML(path, imgfile, imgfilepath): boxes = [] for i in range(0, len(boxes)): f.writelines(["
\n", - "\n", "
\n"]) + f.write("\n") for box in boxes: f.writelines(["
\n", "\n", "
\n"]) - f.write("\n") f.writelines(["\n", "\n"]) f.close() @@ -393,6 +394,8 @@ def buildEPUB(path, chapterNames, tomeNumber): "position: absolute;\n", "width: 100%;\n", "height: 100%;\n", + "top: 0;\n", + "left: 0;\n", "}\n", "#PV-T {\n", "top: 0;\n", @@ -406,41 +409,41 @@ def buildEPUB(path, chapterNames, tomeNumber): "}\n", "#PV-L {\n", "left: 0;\n", - "width: 50%;\n", + "width: 49.5%;\n", "height: 100%;\n", "float: left;\n", "}\n", "#PV-R {\n", "right: 0;\n", - "width: 50%;\n", + "width: 49.5%;\n", "height: 100%;\n", "float: right;\n", "}\n", "#PV-TL {\n", "top: 0;\n", "left: 0;\n", - "width: 50%;\n", + "width: 49.5%;\n", "height: 50%;\n", "float: left;\n", "}\n", "#PV-TR {\n", "top: 0;\n", "right: 0;\n", - "width: 50%;\n", + "width: 49.5%;\n", "height: 50%;\n", "float: right;\n", "}\n", "#PV-BL {\n", "bottom: 0;\n", "left: 0;\n", - "width: 50%;\n", + "width: 49.5%;\n", "height: 50%;\n", "float: left;\n", "}\n", "#PV-BR {\n", "bottom: 0;\n", "right: 0;\n", - "width: 50%;\n", + "width: 49.5%;\n", "height: 50%;\n", "float: right;\n", "}\n", From b2e58127cb1c81a411836b0d48b7a97aa4672f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Wed, 4 Nov 2015 20:41:48 +0100 Subject: [PATCH 2/5] Disabled UPX to decrease startup time --- Dockerfile | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7b369afd..de115f65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN useradd -ms /bin/bash kcc && chown -R kcc:kcc /app USER kcc WORKDIR /app -RUN pyinstaller -F -s kcc.py +RUN pyinstaller -F -s --noupx kcc.py RUN mkdir -p dist/usr/bin dist/usr/share/applications dist/usr/share/doc/kindlecomicconverter dist/usr/share/kindlecomicconverter dist/usr/share/lintian/overrides RUN mv dist/kcc dist/usr/bin RUN cp icons/comic2ebook.png dist/usr/share/kindlecomicconverter diff --git a/setup.py b/setup.py index 57260b09..35c6dce8 100755 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def finalize_options(self): def run(self): if sys.platform == 'darwin': - os.system('pyinstaller -y -F -i icons/comic2ebook.icns -n "Kindle Comic Converter" -w -s kcc.py') + os.system('pyinstaller -y -F -i icons/comic2ebook.icns -n "Kindle Comic Converter" -w -s --noupx kcc.py') shutil.copy('other/osx/7za', 'dist/Kindle Comic Converter.app/Contents/Resources') shutil.copy('other/osx/unrar', 'dist/Kindle Comic Converter.app/Contents/Resources') shutil.copy('other/osx/Info.plist', 'dist/Kindle Comic Converter.app/Contents') @@ -51,7 +51,7 @@ def run(self): os.system('appdmg kcc.json dist/KindleComicConverter_osx_' + VERSION + '.dmg') exit(0) elif sys.platform == 'win32': - os.system('pyinstaller -y -F -i icons\comic2ebook.ico -n KCC -w kcc.py') + os.system('pyinstaller -y -F -i icons\comic2ebook.ico -n KCC -w --noupx kcc.py') if os.path.isfile('setup.bat'): os.system('setup.bat ' + VERSION) exit(0) From df0bafe4b67d096eb4d19e0b121a52146c397244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Wed, 4 Nov 2015 20:42:48 +0100 Subject: [PATCH 3/5] Hopefully fixed Kindle detection anomalies --- kcc/kindle.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kcc/kindle.py b/kcc/kindle.py index ddfe1d51..d00befbe 100644 --- a/kcc/kindle.py +++ b/kcc/kindle.py @@ -29,8 +29,10 @@ def __init__(self): self.coverSupport = False def findDevice(self): - for drive in psutil.disk_partitions(False): - if 'removable' in drive[3] or 'vfat' in drive[2] or 'msdos' in drive[2]: + for drive in reversed(psutil.disk_partitions(False)): + if (drive[2] == 'FAT32' and drive[3] == 'rw,removable') or \ + (drive[2] == 'vfat' and 'rw' in drive[3]) or \ + (drive[2] == 'msdos' and 'rw' in drive[3]): if os.path.isdir(os.path.join(drive[1], 'system')) and \ os.path.isdir(os.path.join(drive[1], 'documents')): return drive[1] From 9543b573e36b90f94888b595c97c1dccbb4d007a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Fri, 6 Nov 2015 19:44:39 +0100 Subject: [PATCH 4/5] Miscellaneous fixes --- kcc/comic2ebook.py | 8 +++----- kcc/shared.py | 14 +++++++------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 7ebde845..48c0fa98 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -107,7 +107,7 @@ def buildHTML(path, imgfile, imgfilepath): os.makedirs(htmlpath) htmlfile = os.path.join(htmlpath, filename[0] + '.xhtml') f = open(htmlfile, "w", encoding='UTF-8') - f.writelines(["", + f.writelines(["\n", "\n", "\n", "\n", @@ -211,8 +211,7 @@ def buildNCX(dstdir, title, chapters, chapterNames): "\n", "\n", "", escape(title), "\n", - "" - ]) + "\n"]) for chapter in chapters: folder = chapter[0].replace(os.path.join(dstdir, 'OEBPS'), '').lstrip('/').lstrip('\\\\') filename = getImageFileName(os.path.join(folder, chapter[1])) @@ -253,8 +252,7 @@ def buildNAV(dstdir, title, chapters, chapterNames): f.writelines(["\n", "\n", "