diff --git a/KindleComicConverter.app/Contents/Info.plist b/KindleComicConverter.app/Contents/Info.plist
index 0eb6ae9..807ec5d 100644
--- a/KindleComicConverter.app/Contents/Info.plist
+++ b/KindleComicConverter.app/Contents/Info.plist
@@ -57,7 +57,7 @@
positionOfDivider
568
savedFrame
- 188 368 889 690 0 0 1920 1058
+ 666 338 889 690 0 0 1680 1028
selectedTabView
event log
diff --git a/KindleComicConverter.app/Contents/Resources/Scripts/main.scpt b/KindleComicConverter.app/Contents/Resources/Scripts/main.scpt
index ac3bb41..34146cf 100644
Binary files a/KindleComicConverter.app/Contents/Resources/Scripts/main.scpt and b/KindleComicConverter.app/Contents/Resources/Scripts/main.scpt differ
diff --git a/KindleComicConverter.app/Contents/Resources/comic2ebook.py b/KindleComicConverter.app/Contents/Resources/comic2ebook.py
index 655f06a..432812c 100755
--- a/KindleComicConverter.app/Contents/Resources/comic2ebook.py
+++ b/KindleComicConverter.app/Contents/Resources/comic2ebook.py
@@ -130,56 +130,67 @@ def isInFilelist(file,list):
seen = True
return seen
-if __name__ == "__main__":
+def Copyright():
print ('comic2ebook v%(__version__)s. '
- 'Written 2012 by Ciro Mattia Gonano.' % globals())
+ 'Written 2012 by Ciro Mattia Gonano.' % globals())
+
+def Usage():
+ print "Generates HTML, NCX and OPF for a Comic ebook from a bunch of images"
+ print "Optimized for creating Mobipockets to be read into Kindle Paperwhite"
+ print "Usage:"
+ print " %s " % sys.argv[0]
+ print " is optional"
+
+def main(argv=None):
+ if argv is None:
+ argv = sys.argv
+ profile = argv[1]
+ dir = argv[2]
+ cbx = cbxarchive.CBxArchive(dir)
+ if cbx.isCbxFile():
+ cbx.extract()
+ dir = cbx.getPath()
+ if len(argv)==4:
+ title = argv[3]
+ else:
+ title = "comic"
+ filelist = []
+ try:
+ print "Splitting double pages..."
+ for file in os.listdir(dir):
+ if (getImageFileName(file) != None):
+ img = image.ComicPage(dir+'/'+file, profile)
+ img.splitPage(dir)
+ for file in os.listdir(dir):
+ if (getImageFileName(file) != None):
+ print "Optimizing " + file + " for " + profile
+ img = image.ComicPage(dir+'/'+file, profile)
+ img.resizeImage()
+ #img.frameImage()
+ img.quantizeImage()
+ img.saveToDir(dir)
+ except ImportError:
+ print "Could not load PIL, not optimizing image"
+
+ 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)
+
+if __name__ == "__main__":
+ Copyright()
if len(sys.argv)<3 or len(sys.argv)>4:
- print "Generates HTML, NCX and OPF for a Comic ebook from a bunch of images"
- print "Optimized for creating Mobipockets to be read into Kindle Paperwhite"
- print "Usage:"
- print " %s " % sys.argv[0]
- print " is optional"
+ Usage()
sys.exit(1)
else:
- profile = sys.argv[1]
- dir = sys.argv[2]
- cbx = cbxarchive.CBxArchive(dir)
- if cbx.isCbxFile():
- cbx.extract()
- dir = cbx.getPath()
- if len(sys.argv)==4:
- title = sys.argv[3]
- else:
- title = "comic"
- filelist = []
- try:
- print "Splitting double pages..."
- for file in os.listdir(dir):
- if (getImageFileName(file) != None):
- img = image.ComicPage(dir+'/'+file, profile)
- img.splitPage(dir)
- for file in os.listdir(dir):
- if (getImageFileName(file) != None):
- print "Optimizing " + file + " for " + profile
- img = image.ComicPage(dir+'/'+file, profile)
- img.resizeImage()
- #img.frameImage()
- img.quantizeImage()
- img.saveToDir(dir)
- except ImportError:
- print "Could not load PIL, not optimizing image"
-
- 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)
+ main()
sys.exit(0)
diff --git a/KindleComicConverter.app/Contents/Resources/rarfile.py b/KindleComicConverter.app/Contents/Resources/rarfile.py
index d78aafe..7c846e5 100644
--- a/KindleComicConverter.app/Contents/Resources/rarfile.py
+++ b/KindleComicConverter.app/Contents/Resources/rarfile.py
@@ -1699,6 +1699,10 @@ def custom_popen(cmd):
if sys.platform == 'win32':
creationflags = 0x08000000 # CREATE_NO_WINDOW
+ out_file = open("/tmp/test.txt","w")
+ out_file.write('[%s]' % ', '.join(map(str, cmd)))
+ out_file.close()
+
# run command
p = Popen(cmd, bufsize = 0, stdout = PIPE, stdin = PIPE, stderr = STDOUT,
creationflags = creationflags)
diff --git a/syncDroplet.sh b/syncDroplet.sh
index 3464b2e..2457e1b 100755
--- a/syncDroplet.sh
+++ b/syncDroplet.sh
@@ -4,3 +4,4 @@ cp -a resources/Scripts resources/description.rtfd resources/droplet.rsrc Kindle
cp resources/Info.plist KindleComicConverter.app/Contents/
cp resources/comic2ebook.icns KindleComicConverter.app/Contents/Resources/droplet.icns
cp kcc/*.py KindleComicConverter.app/Contents/Resources/
+cp `which unrar` KindleComicConverter.app/Contents/Resources/
\ No newline at end of file