1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

Ensure filelist is alphabetically sorted

This commit is contained in:
Ciro Mattia Gonano
2012-12-06 15:09:42 +01:00
parent 5fe3aabc4f
commit 8d3b8c1b42

View File

@@ -164,7 +164,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 +172,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)