about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile4
-rw-r--r--README.md5
-rw-r--r--kcc.iss2
-rw-r--r--kcc/__init__.py2
-rwxr-xr-xkcc/comic2ebook.py27
-rw-r--r--kcc/kindle.py6
-rw-r--r--kcc/shared.py14
-rw-r--r--other/osx/Info.plist6
-rwxr-xr-xsetup.py4
9 files changed, 39 insertions, 31 deletions
diff --git a/Dockerfile b/Dockerfile
index 7b369af..361fb8a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,7 +3,7 @@
 FROM acidweb/kcc-base
 MAINTAINER Paweł Jastrzębski <[email protected]>
 
-ENV KCCVER 5.0
+ENV KCCVER 5.0.1
 ADD . /app
 
 RUN pip3 install pillow python-slugify psutil scandir pyinstaller
@@ -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/README.md b/README.md
index 2a97d61..678e6ae 100644
--- a/README.md
+++ b/README.md
@@ -155,6 +155,11 @@ The app relies and includes the following scripts:
 * [Kobo Aura H2O](http://kcc.iosphe.re/Samples/Ubunchu-KoAH2O.kepub.epub)
 
 ## CHANGELOG
+####5.0.1:
+* Fixed Panel View placement issues
+* Decreased application startup time
+* Fixed multiple smaller issues
+
 ####5.0:
 * Major overhaul of internal mechanisms and GUI
 * Added cover upload feature
diff --git a/kcc.iss b/kcc.iss
index be189a8..749e586 100644
--- a/kcc.iss
+++ b/kcc.iss
@@ -1,5 +1,5 @@
 #define MyAppName "Kindle Comic Converter"
-#define MyAppVersion "5.0"
+#define MyAppVersion "5.0.1"
 #define MyAppPublisher "Ciro Mattia Gonano, Paweł Jastrzębski"
 #define MyAppURL "http://kcc.iosphe.re/"
 #define MyAppExeName "KCC.exe"
diff --git a/kcc/__init__.py b/kcc/__init__.py
index c561082..04c0270 100644
--- a/kcc/__init__.py
+++ b/kcc/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '5.0'
+__version__ = '5.0.1'
 __license__ = 'ISC'
 __copyright__ = '2012-2015, Ciro Mattia Gonano <[email protected]>, Pawel Jastrzebski <[email protected]>'
 __docformat__ = 'restructuredtext en'
diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py
index 69ea6b5..48c0fa9 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(["<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
+    f.writelines(["<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
                   "<!DOCTYPE html>\n",
                   "<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\">\n",
                   "<head>\n",
@@ -182,15 +182,16 @@ def buildHTML(path, imgfile, imgfilepath):
             boxes = []
         for i in range(0, len(boxes)):
             f.writelines(["<div id=\"" + boxes[i] + "\">\n",
-                          "<a class=\"app-amzn-magnify\" data-app-amzn-magnify='{\"targetId\":\"" + boxes[i] +
+                          "<a style=\"display:inline-block;width:100%;height:100%;\" class=\"app-amzn-magnify\" "
+                          "data-app-amzn-magnify='{\"targetId\":\"" + boxes[i] +
                           "-P\", \"ordinal\":" + str(order[i]) + "}'></a>\n",
                           "</div>\n"])
+        f.write("</div>\n")
         for box in boxes:
             f.writelines(["<div class=\"PV-P\" id=\"" + box + "-P\" style=\"" + additionalStyle + "\">\n",
                           "<img style=\"" + boxStyles[box] + "\" src=\"", "../" * backref, "Images/", postfix,
                           imgfilepv, "\" width=\"" + str(size[0]) + "\" height=\"" + str(size[1]) + "\"/>\n",
                           "</div>\n"])
-        f.write("</div>\n")
     f.writelines(["</body>\n",
                   "</html>\n"])
     f.close()
@@ -210,8 +211,7 @@ def buildNCX(dstdir, title, chapters, chapterNames):
                   "<meta name=\"generated\" content=\"true\"/>\n",
                   "</head>\n",
                   "<docTitle><text>", escape(title), "</text></docTitle>\n",
-                  "<navMap>"
-                  ])
+                  "<navMap>\n"])
     for chapter in chapters:
         folder = chapter[0].replace(os.path.join(dstdir, 'OEBPS'), '').lstrip('/').lstrip('\\\\')
         filename = getImageFileName(os.path.join(folder, chapter[1]))
@@ -252,8 +252,7 @@ def buildNAV(dstdir, title, chapters, chapterNames):
     f.writelines(["</ol>\n",
                   "</nav>\n",
                   "<nav epub:type=\"page-list\">\n",
-                  "<ol>\n"
-                  ])
+                  "<ol>\n"])
     for chapter in chapters:
         folder = chapter[0].replace(os.path.join(dstdir, 'OEBPS'), '').lstrip('/').lstrip('\\\\')
         filename = getImageFileName(os.path.join(folder, chapter[1]))
@@ -393,6 +392,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 +407,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",
diff --git a/kcc/kindle.py b/kcc/kindle.py
index ddfe1d5..d00befb 100644
--- a/kcc/kindle.py
+++ b/kcc/kindle.py
@@ -29,8 +29,10 @@ class Kindle:
             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]
diff --git a/kcc/shared.py b/kcc/shared.py
index b363998..72b5020 100644
--- a/kcc/shared.py
+++ b/kcc/shared.py
@@ -97,27 +97,27 @@ def check7ZFile(filePath):
 
 
 def saferReplace(old, new):
-    for x in range(50):
+    for x in range(10):
         try:
             os.replace(old, new)
         except PermissionError:
-            sleep(0.1)
+            sleep(1)
         else:
             break
     else:
-        raise PermissionError
+        raise PermissionError("Failed to move the file.")
 
 
 def saferRemove(target):
-    for x in range(50):
+    for x in range(10):
         try:
             os.remove(target)
         except PermissionError:
-            sleep(0.1)
+            sleep(1)
         else:
             break
     else:
-        raise PermissionError
+        raise PermissionError("Failed to remove the file.")
 
 
 def removeFromZIP(zipfname, *filenames):
@@ -146,7 +146,7 @@ def sanitizeTrace(traceback):
     return ''.join(format_tb(traceback))\
         .replace('C:\\Users\\pawel\\Documents\\Projekty\\KCC\\', '')\
         .replace('C:\\Python34\\', '')\
-        .replace('C:\\Python34_64\\', '')
+        .replace('c:\\python34\\', '')
 
 
 def dependencyCheck(level):
diff --git a/other/osx/Info.plist b/other/osx/Info.plist
index bb87c7d..cda8b2d 100644
--- a/other/osx/Info.plist
+++ b/other/osx/Info.plist
@@ -9,7 +9,7 @@
 	<key>CFBundleExecutable</key>
 	<string>MacOS/Kindle Comic Converter</string>
 	<key>CFBundleGetInfoString</key>
-	<string>KindleComicConverter 5.0, written 2012-2015 by Ciro Mattia Gonano and Pawel Jastrzebski</string>
+	<string>KindleComicConverter 5.0.1, written 2012-2015 by Ciro Mattia Gonano and Pawel Jastrzebski</string>
 	<key>CFBundleIconFile</key>
 	<string>comic2ebook.icns</string>
 	<key>CFBundleIdentifier</key>
@@ -21,11 +21,11 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>5.0.0</string>
+	<string>5.0.1</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>5.0.0</string>
+	<string>5.0.1</string>
 	<key>LSEnvironment</key>
 	<dict>
 		<key>PATH</key>
diff --git a/setup.py b/setup.py
index 57260b0..35c6dce 100755
--- a/setup.py
+++ b/setup.py
@@ -38,7 +38,7 @@ class BuildBinaryCommand(distutils.cmd.Command):
 
     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 @@ class BuildBinaryCommand(distutils.cmd.Command):
             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)