mirror of
https://github.com/ciromattia/kcc
synced 2025-12-15 18:56:28 +00:00
Merge branch 'tamodolo-master' into dev
This commit is contained in:
@@ -1230,8 +1230,9 @@ def makeMOBIWorker(item):
|
|||||||
kindlegenError = ''
|
kindlegenError = ''
|
||||||
try:
|
try:
|
||||||
if os.path.getsize(item) < 629145600:
|
if os.path.getsize(item) < 629145600:
|
||||||
|
print("Creating MOBI file...")
|
||||||
output = Popen('kindlegen -dont_append_source -locale en "' + item + '"',
|
output = Popen('kindlegen -dont_append_source -locale en "' + item + '"',
|
||||||
stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True)
|
stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=False)
|
||||||
for line in output.stdout:
|
for line in output.stdout:
|
||||||
line = line.decode('utf-8')
|
line = line.decode('utf-8')
|
||||||
# ERROR: Generic error
|
# ERROR: Generic error
|
||||||
@@ -1243,6 +1244,8 @@ def makeMOBIWorker(item):
|
|||||||
kindlegenErrorCode = 23026
|
kindlegenErrorCode = 23026
|
||||||
if kindlegenErrorCode > 0:
|
if kindlegenErrorCode > 0:
|
||||||
break
|
break
|
||||||
|
if "Mobi file built successfully" in line:
|
||||||
|
output.terminate()
|
||||||
else:
|
else:
|
||||||
# ERROR: EPUB too big
|
# ERROR: EPUB too big
|
||||||
kindlegenErrorCode = 23026
|
kindlegenErrorCode = 23026
|
||||||
|
|||||||
Reference in New Issue
Block a user