mirror of
https://github.com/ciromattia/kcc
synced 2025-12-15 18:56:28 +00:00
@@ -3,7 +3,7 @@
|
|||||||
FROM acidweb/kcc-base
|
FROM acidweb/kcc-base
|
||||||
MAINTAINER Paweł Jastrzębski <pawelj@iosphe.re>
|
MAINTAINER Paweł Jastrzębski <pawelj@iosphe.re>
|
||||||
|
|
||||||
ENV KCCVER 5.0
|
ENV KCCVER 5.0.1
|
||||||
ADD . /app
|
ADD . /app
|
||||||
|
|
||||||
RUN pip3 install pillow python-slugify psutil scandir pyinstaller
|
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
|
USER kcc
|
||||||
WORKDIR /app
|
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 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 mv dist/kcc dist/usr/bin
|
||||||
RUN cp icons/comic2ebook.png dist/usr/share/kindlecomicconverter
|
RUN cp icons/comic2ebook.png dist/usr/share/kindlecomicconverter
|
||||||
|
|||||||
@@ -155,6 +155,11 @@ The app relies and includes the following scripts:
|
|||||||
* [Kobo Aura H2O](http://kcc.iosphe.re/Samples/Ubunchu-KoAH2O.kepub.epub)
|
* [Kobo Aura H2O](http://kcc.iosphe.re/Samples/Ubunchu-KoAH2O.kepub.epub)
|
||||||
|
|
||||||
## CHANGELOG
|
## CHANGELOG
|
||||||
|
####5.0.1:
|
||||||
|
* Fixed Panel View placement issues
|
||||||
|
* Decreased application startup time
|
||||||
|
* Fixed multiple smaller issues
|
||||||
|
|
||||||
####5.0:
|
####5.0:
|
||||||
* Major overhaul of internal mechanisms and GUI
|
* Major overhaul of internal mechanisms and GUI
|
||||||
* Added cover upload feature
|
* Added cover upload feature
|
||||||
|
|||||||
2
kcc.iss
2
kcc.iss
@@ -1,5 +1,5 @@
|
|||||||
#define MyAppName "Kindle Comic Converter"
|
#define MyAppName "Kindle Comic Converter"
|
||||||
#define MyAppVersion "5.0"
|
#define MyAppVersion "5.0.1"
|
||||||
#define MyAppPublisher "Ciro Mattia Gonano, Paweł Jastrzębski"
|
#define MyAppPublisher "Ciro Mattia Gonano, Paweł Jastrzębski"
|
||||||
#define MyAppURL "http://kcc.iosphe.re/"
|
#define MyAppURL "http://kcc.iosphe.re/"
|
||||||
#define MyAppExeName "KCC.exe"
|
#define MyAppExeName "KCC.exe"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
__version__ = '5.0'
|
__version__ = '5.0.1'
|
||||||
__license__ = 'ISC'
|
__license__ = 'ISC'
|
||||||
__copyright__ = '2012-2015, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@iosphe.re>'
|
__copyright__ = '2012-2015, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@iosphe.re>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ def buildHTML(path, imgfile, imgfilepath):
|
|||||||
os.makedirs(htmlpath)
|
os.makedirs(htmlpath)
|
||||||
htmlfile = os.path.join(htmlpath, filename[0] + '.xhtml')
|
htmlfile = os.path.join(htmlpath, filename[0] + '.xhtml')
|
||||||
f = open(htmlfile, "w", encoding='UTF-8')
|
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",
|
"<!DOCTYPE html>\n",
|
||||||
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\">\n",
|
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\">\n",
|
||||||
"<head>\n",
|
"<head>\n",
|
||||||
@@ -182,15 +182,16 @@ def buildHTML(path, imgfile, imgfilepath):
|
|||||||
boxes = []
|
boxes = []
|
||||||
for i in range(0, len(boxes)):
|
for i in range(0, len(boxes)):
|
||||||
f.writelines(["<div id=\"" + boxes[i] + "\">\n",
|
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",
|
"-P\", \"ordinal\":" + str(order[i]) + "}'></a>\n",
|
||||||
"</div>\n"])
|
"</div>\n"])
|
||||||
|
f.write("</div>\n")
|
||||||
for box in boxes:
|
for box in boxes:
|
||||||
f.writelines(["<div class=\"PV-P\" id=\"" + box + "-P\" style=\"" + additionalStyle + "\">\n",
|
f.writelines(["<div class=\"PV-P\" id=\"" + box + "-P\" style=\"" + additionalStyle + "\">\n",
|
||||||
"<img style=\"" + boxStyles[box] + "\" src=\"", "../" * backref, "Images/", postfix,
|
"<img style=\"" + boxStyles[box] + "\" src=\"", "../" * backref, "Images/", postfix,
|
||||||
imgfilepv, "\" width=\"" + str(size[0]) + "\" height=\"" + str(size[1]) + "\"/>\n",
|
imgfilepv, "\" width=\"" + str(size[0]) + "\" height=\"" + str(size[1]) + "\"/>\n",
|
||||||
"</div>\n"])
|
"</div>\n"])
|
||||||
f.write("</div>\n")
|
|
||||||
f.writelines(["</body>\n",
|
f.writelines(["</body>\n",
|
||||||
"</html>\n"])
|
"</html>\n"])
|
||||||
f.close()
|
f.close()
|
||||||
@@ -210,8 +211,7 @@ def buildNCX(dstdir, title, chapters, chapterNames):
|
|||||||
"<meta name=\"generated\" content=\"true\"/>\n",
|
"<meta name=\"generated\" content=\"true\"/>\n",
|
||||||
"</head>\n",
|
"</head>\n",
|
||||||
"<docTitle><text>", escape(title), "</text></docTitle>\n",
|
"<docTitle><text>", escape(title), "</text></docTitle>\n",
|
||||||
"<navMap>"
|
"<navMap>\n"])
|
||||||
])
|
|
||||||
for chapter in chapters:
|
for chapter in chapters:
|
||||||
folder = chapter[0].replace(os.path.join(dstdir, 'OEBPS'), '').lstrip('/').lstrip('\\\\')
|
folder = chapter[0].replace(os.path.join(dstdir, 'OEBPS'), '').lstrip('/').lstrip('\\\\')
|
||||||
filename = getImageFileName(os.path.join(folder, chapter[1]))
|
filename = getImageFileName(os.path.join(folder, chapter[1]))
|
||||||
@@ -252,8 +252,7 @@ def buildNAV(dstdir, title, chapters, chapterNames):
|
|||||||
f.writelines(["</ol>\n",
|
f.writelines(["</ol>\n",
|
||||||
"</nav>\n",
|
"</nav>\n",
|
||||||
"<nav epub:type=\"page-list\">\n",
|
"<nav epub:type=\"page-list\">\n",
|
||||||
"<ol>\n"
|
"<ol>\n"])
|
||||||
])
|
|
||||||
for chapter in chapters:
|
for chapter in chapters:
|
||||||
folder = chapter[0].replace(os.path.join(dstdir, 'OEBPS'), '').lstrip('/').lstrip('\\\\')
|
folder = chapter[0].replace(os.path.join(dstdir, 'OEBPS'), '').lstrip('/').lstrip('\\\\')
|
||||||
filename = getImageFileName(os.path.join(folder, chapter[1]))
|
filename = getImageFileName(os.path.join(folder, chapter[1]))
|
||||||
@@ -393,6 +392,8 @@ def buildEPUB(path, chapterNames, tomeNumber):
|
|||||||
"position: absolute;\n",
|
"position: absolute;\n",
|
||||||
"width: 100%;\n",
|
"width: 100%;\n",
|
||||||
"height: 100%;\n",
|
"height: 100%;\n",
|
||||||
|
"top: 0;\n",
|
||||||
|
"left: 0;\n",
|
||||||
"}\n",
|
"}\n",
|
||||||
"#PV-T {\n",
|
"#PV-T {\n",
|
||||||
"top: 0;\n",
|
"top: 0;\n",
|
||||||
@@ -406,41 +407,41 @@ def buildEPUB(path, chapterNames, tomeNumber):
|
|||||||
"}\n",
|
"}\n",
|
||||||
"#PV-L {\n",
|
"#PV-L {\n",
|
||||||
"left: 0;\n",
|
"left: 0;\n",
|
||||||
"width: 50%;\n",
|
"width: 49.5%;\n",
|
||||||
"height: 100%;\n",
|
"height: 100%;\n",
|
||||||
"float: left;\n",
|
"float: left;\n",
|
||||||
"}\n",
|
"}\n",
|
||||||
"#PV-R {\n",
|
"#PV-R {\n",
|
||||||
"right: 0;\n",
|
"right: 0;\n",
|
||||||
"width: 50%;\n",
|
"width: 49.5%;\n",
|
||||||
"height: 100%;\n",
|
"height: 100%;\n",
|
||||||
"float: right;\n",
|
"float: right;\n",
|
||||||
"}\n",
|
"}\n",
|
||||||
"#PV-TL {\n",
|
"#PV-TL {\n",
|
||||||
"top: 0;\n",
|
"top: 0;\n",
|
||||||
"left: 0;\n",
|
"left: 0;\n",
|
||||||
"width: 50%;\n",
|
"width: 49.5%;\n",
|
||||||
"height: 50%;\n",
|
"height: 50%;\n",
|
||||||
"float: left;\n",
|
"float: left;\n",
|
||||||
"}\n",
|
"}\n",
|
||||||
"#PV-TR {\n",
|
"#PV-TR {\n",
|
||||||
"top: 0;\n",
|
"top: 0;\n",
|
||||||
"right: 0;\n",
|
"right: 0;\n",
|
||||||
"width: 50%;\n",
|
"width: 49.5%;\n",
|
||||||
"height: 50%;\n",
|
"height: 50%;\n",
|
||||||
"float: right;\n",
|
"float: right;\n",
|
||||||
"}\n",
|
"}\n",
|
||||||
"#PV-BL {\n",
|
"#PV-BL {\n",
|
||||||
"bottom: 0;\n",
|
"bottom: 0;\n",
|
||||||
"left: 0;\n",
|
"left: 0;\n",
|
||||||
"width: 50%;\n",
|
"width: 49.5%;\n",
|
||||||
"height: 50%;\n",
|
"height: 50%;\n",
|
||||||
"float: left;\n",
|
"float: left;\n",
|
||||||
"}\n",
|
"}\n",
|
||||||
"#PV-BR {\n",
|
"#PV-BR {\n",
|
||||||
"bottom: 0;\n",
|
"bottom: 0;\n",
|
||||||
"right: 0;\n",
|
"right: 0;\n",
|
||||||
"width: 50%;\n",
|
"width: 49.5%;\n",
|
||||||
"height: 50%;\n",
|
"height: 50%;\n",
|
||||||
"float: right;\n",
|
"float: right;\n",
|
||||||
"}\n",
|
"}\n",
|
||||||
|
|||||||
@@ -29,8 +29,10 @@ class Kindle:
|
|||||||
self.coverSupport = False
|
self.coverSupport = False
|
||||||
|
|
||||||
def findDevice(self):
|
def findDevice(self):
|
||||||
for drive in psutil.disk_partitions(False):
|
for drive in reversed(psutil.disk_partitions(False)):
|
||||||
if 'removable' in drive[3] or 'vfat' in drive[2] or 'msdos' in drive[2]:
|
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 \
|
if os.path.isdir(os.path.join(drive[1], 'system')) and \
|
||||||
os.path.isdir(os.path.join(drive[1], 'documents')):
|
os.path.isdir(os.path.join(drive[1], 'documents')):
|
||||||
return drive[1]
|
return drive[1]
|
||||||
|
|||||||
@@ -97,27 +97,27 @@ def check7ZFile(filePath):
|
|||||||
|
|
||||||
|
|
||||||
def saferReplace(old, new):
|
def saferReplace(old, new):
|
||||||
for x in range(50):
|
for x in range(10):
|
||||||
try:
|
try:
|
||||||
os.replace(old, new)
|
os.replace(old, new)
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
sleep(0.1)
|
sleep(1)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise PermissionError
|
raise PermissionError("Failed to move the file.")
|
||||||
|
|
||||||
|
|
||||||
def saferRemove(target):
|
def saferRemove(target):
|
||||||
for x in range(50):
|
for x in range(10):
|
||||||
try:
|
try:
|
||||||
os.remove(target)
|
os.remove(target)
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
sleep(0.1)
|
sleep(1)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise PermissionError
|
raise PermissionError("Failed to remove the file.")
|
||||||
|
|
||||||
|
|
||||||
def removeFromZIP(zipfname, *filenames):
|
def removeFromZIP(zipfname, *filenames):
|
||||||
@@ -146,7 +146,7 @@ def sanitizeTrace(traceback):
|
|||||||
return ''.join(format_tb(traceback))\
|
return ''.join(format_tb(traceback))\
|
||||||
.replace('C:\\Users\\pawel\\Documents\\Projekty\\KCC\\', '')\
|
.replace('C:\\Users\\pawel\\Documents\\Projekty\\KCC\\', '')\
|
||||||
.replace('C:\\Python34\\', '')\
|
.replace('C:\\Python34\\', '')\
|
||||||
.replace('C:\\Python34_64\\', '')
|
.replace('c:\\python34\\', '')
|
||||||
|
|
||||||
|
|
||||||
def dependencyCheck(level):
|
def dependencyCheck(level):
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>MacOS/Kindle Comic Converter</string>
|
<string>MacOS/Kindle Comic Converter</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<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>
|
<key>CFBundleIconFile</key>
|
||||||
<string>comic2ebook.icns</string>
|
<string>comic2ebook.icns</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
@@ -21,11 +21,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>5.0.0</string>
|
<string>5.0.1</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>5.0.0</string>
|
<string>5.0.1</string>
|
||||||
<key>LSEnvironment</key>
|
<key>LSEnvironment</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>PATH</key>
|
<key>PATH</key>
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -38,7 +38,7 @@ class BuildBinaryCommand(distutils.cmd.Command):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if sys.platform == 'darwin':
|
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/7za', 'dist/Kindle Comic Converter.app/Contents/Resources')
|
||||||
shutil.copy('other/osx/unrar', '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')
|
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')
|
os.system('appdmg kcc.json dist/KindleComicConverter_osx_' + VERSION + '.dmg')
|
||||||
exit(0)
|
exit(0)
|
||||||
elif sys.platform == 'win32':
|
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'):
|
if os.path.isfile('setup.bat'):
|
||||||
os.system('setup.bat ' + VERSION)
|
os.system('setup.bat ' + VERSION)
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user