mirror of
https://github.com/ciromattia/kcc
synced 2026-06-19 04:50:51 +00:00
Preparing the field for switching towards a full-fledged app (get rid of AppleScript) via py2app/py2exe
This commit is contained in:
@@ -35,7 +35,7 @@ __version__ = '1.20'
|
||||
|
||||
import os
|
||||
import sys
|
||||
import cbxarchive
|
||||
import image, cbxarchive
|
||||
|
||||
class HTMLbuilder:
|
||||
|
||||
@@ -153,7 +153,6 @@ if __name__ == "__main__":
|
||||
title = "comic"
|
||||
filelist = []
|
||||
try:
|
||||
import image
|
||||
print "Splitting double pages..."
|
||||
for file in os.listdir(dir):
|
||||
if (getImageFileName(file) != None):
|
||||
@@ -164,7 +163,7 @@ if __name__ == "__main__":
|
||||
print "Optimizing " + file + " for " + profile
|
||||
img = image.ComicPage(dir+'/'+file, profile)
|
||||
img.resizeImage()
|
||||
img.frameImage()
|
||||
#img.frameImage()
|
||||
img.quantizeImage()
|
||||
img.saveToDir(dir)
|
||||
except ImportError:
|
||||
@@ -172,9 +171,15 @@ if __name__ == "__main__":
|
||||
|
||||
for file in os.listdir(dir):
|
||||
if (getImageFileName(file) != None and isInFilelist(file,filelist) == False):
|
||||
# put credits at the end
|
||||
if "credits" in file.lower():
|
||||
os.rename(dir+'/'+file, dir+'/ZZZ999_'+file)
|
||||
file = 'ZZZ999_'+file
|
||||
filename = HTMLbuilder(dir,file).getResult()
|
||||
if (filename != None):
|
||||
filelist.append(filename)
|
||||
NCXbuilder(dir,title)
|
||||
# ensure we're sorting files alphabetically
|
||||
filelist = sorted(filelist, key=lambda name: name[0])
|
||||
OPFBuilder(dir,title,filelist)
|
||||
sys.exit(0)
|
||||
|
||||
Reference in New Issue
Block a user