mirror of
https://github.com/ciromattia/kcc
synced 2025-12-24 07:01:51 +00:00
Ensure filelist is alphabetically sorted
This commit is contained in:
@@ -164,7 +164,7 @@ if __name__ == "__main__":
|
|||||||
print "Optimizing " + file + " for " + profile
|
print "Optimizing " + file + " for " + profile
|
||||||
img = image.ComicPage(dir+'/'+file, profile)
|
img = image.ComicPage(dir+'/'+file, profile)
|
||||||
img.resizeImage()
|
img.resizeImage()
|
||||||
img.frameImage()
|
#img.frameImage()
|
||||||
img.quantizeImage()
|
img.quantizeImage()
|
||||||
img.saveToDir(dir)
|
img.saveToDir(dir)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@@ -172,9 +172,15 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
for file in os.listdir(dir):
|
for file in os.listdir(dir):
|
||||||
if (getImageFileName(file) != None and isInFilelist(file,filelist) == False):
|
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()
|
filename = HTMLbuilder(dir,file).getResult()
|
||||||
if (filename != None):
|
if (filename != None):
|
||||||
filelist.append(filename)
|
filelist.append(filename)
|
||||||
NCXbuilder(dir,title)
|
NCXbuilder(dir,title)
|
||||||
|
# ensure we're sorting files alphabetically
|
||||||
|
filelist = sorted(filelist, key=lambda name: name[0])
|
||||||
OPFBuilder(dir,title,filelist)
|
OPFBuilder(dir,title,filelist)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user