1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-16 03:06:33 +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>
<real>568</real>
<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>
<string>event log</string>
</dict>

View File

@@ -130,25 +130,28 @@ 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())
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 "Optimized for creating Mobipockets to be read into Kindle Paperwhite"
print "Usage:"
print " %s <profile> <dir> <title>" % sys.argv[0]
print " <title> is optional"
sys.exit(1)
else:
profile = sys.argv[1]
dir = sys.argv[2]
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(sys.argv)==4:
title = sys.argv[3]
if len(argv)==4:
title = argv[3]
else:
title = "comic"
filelist = []
@@ -182,4 +185,12 @@ if __name__ == "__main__":
# 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:
Usage()
sys.exit(1)
else:
main()
sys.exit(0)

View File

@@ -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)

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/comic2ebook.icns KindleComicConverter.app/Contents/Resources/droplet.icns
cp kcc/*.py KindleComicConverter.app/Contents/Resources/
cp `which unrar` KindleComicConverter.app/Contents/Resources/