Formatting and PEP-8 codestyle
This commit is contained in:
1 parent
3c187889d1
commit
cc3237d051
2 files changed
+10
-8
No files matched your search
+9
-7
@@ -86,6 +86,7 @@ def buildHTML(path, imgfile):
|
||||
f.close()
|
||||
return path, imgfile
|
||||
|
||||
|
||||
def buildBlankHTML(path):
|
||||
f = open(os.path.join(path, 'blank.html'), "w")
|
||||
f.writelines(["<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" ",
|
||||
@@ -97,11 +98,11 @@ def buildBlankHTML(path):
|
||||
"</head>\n",
|
||||
"<body>\n",
|
||||
"</body>\n",
|
||||
"</html>"
|
||||
])
|
||||
"</html>"])
|
||||
f.close()
|
||||
return path
|
||||
|
||||
|
||||
def buildNCX(dstdir, title, chapters):
|
||||
ncxfile = os.path.join(dstdir, 'OEBPS', 'toc.ncx')
|
||||
f = open(ncxfile, "w")
|
||||
@@ -197,7 +198,8 @@ def buildOPF(profile, dstdir, title, filelist, cover=None, righttoleft=False):
|
||||
f.write("</manifest>\n<spine toc=\"ncx\">\n")
|
||||
for entry in reflist:
|
||||
if entry.endswith("-1"):
|
||||
if ((righttoleft and facing == 'left') or (not righttoleft and facing == 'right')) and (options.profile == 'K4' or options.profile == 'KHD'):
|
||||
if (righttoleft and facing == 'left') or (not righttoleft and facing == 'right') and \
|
||||
(options.profile == 'K4' or options.profile == 'KHD'):
|
||||
f.write("<itemref idref=\"blank-page\" properties=\"layout-blank\"/>\n")
|
||||
f.write("<itemref idref=\"page_" + entry + "\" properties=\"page-spread-" + facing1 + "\"/>\n")
|
||||
elif entry.endswith("-2"):
|
||||
@@ -277,11 +279,11 @@ def dirImgProcess(path):
|
||||
if options.verbose:
|
||||
print "Splitted " + afile
|
||||
if options.righttoleft:
|
||||
toRight1 = False;
|
||||
toRight2 = True;
|
||||
toRight1 = False
|
||||
toRight2 = True
|
||||
else:
|
||||
toRight1 = True;
|
||||
toRight2 = False;
|
||||
toRight1 = True
|
||||
toRight2 = False
|
||||
img0 = image.ComicPage(split[0], options.profile)
|
||||
applyImgOptimization(img0, True, toRight1)
|
||||
img0.saveToDir(dirpath)
|
||||
|
||||
@@ -57,7 +57,7 @@ setup(
|
||||
version=VERSION,
|
||||
author="Ciro Mattia Gonano",
|
||||
author_email="ciromattia@gmail.com",
|
||||
description=("A tool to convert comics (CBR/CBZ/PDFs/image folders) to Mobipocket."),
|
||||
description="A tool to convert comics (CBR/CBZ/PDFs/image folders) to Mobipocket.",
|
||||
license = "ISC License (ISCL)",
|
||||
keywords = "kindle comic mobipocket mobi cbz cbr manga",
|
||||
url = "http://github.com/ciromattia/kcc",
|
||||
|
||||
Reference in new issue
Block a user