1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-20 05:01:55 +00:00

Fix for hardcoded kindlegen HD path.

This commit is contained in:
Ciro Mattia Gonano
2012-12-18 11:39:35 +01:00
parent dd90ab5908
commit fba598d5bf
5 changed files with 65 additions and 49 deletions

View File

@@ -57,7 +57,7 @@
<key>positionOfDivider</key> <key>positionOfDivider</key>
<real>568</real> <real>568</real>
<key>savedFrame</key> <key>savedFrame</key>
<string>188 368 889 690 0 0 1920 1058 </string> <string>666 338 889 690 0 0 1680 1028 </string>
<key>selectedTabView</key> <key>selectedTabView</key>
<string>event log</string> <string>event log</string>
</dict> </dict>

View File

@@ -130,25 +130,28 @@ def isInFilelist(file,list):
seen = True seen = True
return seen return seen
if __name__ == "__main__": def Copyright():
print ('comic2ebook v%(__version__)s. ' print ('comic2ebook v%(__version__)s. '
'Written 2012 by Ciro Mattia Gonano.' % globals()) 'Written 2012 by Ciro Mattia Gonano.' % globals())
if len(sys.argv)<3 or len(sys.argv)>4:
def Usage():
print "Generates HTML, NCX and OPF for a Comic ebook from a bunch of images" 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 "Optimized for creating Mobipockets to be read into Kindle Paperwhite"
print "Usage:" print "Usage:"
print " %s <profile> <dir> <title>" % sys.argv[0] print " %s <profile> <dir> <title>" % sys.argv[0]
print " <title> is optional" print " <title> is optional"
sys.exit(1)
else: def main(argv=None):
profile = sys.argv[1] if argv is None:
dir = sys.argv[2] argv = sys.argv
profile = argv[1]
dir = argv[2]
cbx = cbxarchive.CBxArchive(dir) cbx = cbxarchive.CBxArchive(dir)
if cbx.isCbxFile(): if cbx.isCbxFile():
cbx.extract() cbx.extract()
dir = cbx.getPath() dir = cbx.getPath()
if len(sys.argv)==4: if len(argv)==4:
title = sys.argv[3] title = argv[3]
else: else:
title = "comic" title = "comic"
filelist = [] filelist = []
@@ -182,4 +185,12 @@ if __name__ == "__main__":
# ensure we're sorting files alphabetically # ensure we're sorting files alphabetically
filelist = sorted(filelist, key=lambda name: name[0]) filelist = sorted(filelist, key=lambda name: name[0])
OPFBuilder(dir,title,filelist) OPFBuilder(dir,title,filelist)
if __name__ == "__main__":
Copyright()
if len(sys.argv)<3 or len(sys.argv)>4:
Usage()
sys.exit(1)
else:
main()
sys.exit(0) sys.exit(0)

View File

@@ -1699,6 +1699,10 @@ def custom_popen(cmd):
if sys.platform == 'win32': if sys.platform == 'win32':
creationflags = 0x08000000 # CREATE_NO_WINDOW 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 # run command
p = Popen(cmd, bufsize = 0, stdout = PIPE, stdin = PIPE, stderr = STDOUT, p = Popen(cmd, bufsize = 0, stdout = PIPE, stdin = PIPE, stderr = STDOUT,
creationflags = creationflags) creationflags = creationflags)

View File

@@ -4,3 +4,4 @@ cp -a resources/Scripts resources/description.rtfd resources/droplet.rsrc Kindle
cp resources/Info.plist KindleComicConverter.app/Contents/ cp resources/Info.plist KindleComicConverter.app/Contents/
cp resources/comic2ebook.icns KindleComicConverter.app/Contents/Resources/droplet.icns cp resources/comic2ebook.icns KindleComicConverter.app/Contents/Resources/droplet.icns
cp kcc/*.py KindleComicConverter.app/Contents/Resources/ cp kcc/*.py KindleComicConverter.app/Contents/Resources/
cp `which unrar` KindleComicConverter.app/Contents/Resources/