Merge branch 'multifile' of git://github.com/theaquamarine/kcc into 4.x

This commit is contained in:
Paweł Jastrzębski committed 2014-10-29 07:14:39 +01:00
commit 40b988f964
1 file changed
+11 -3
+11 -3
View File
@@ -25,6 +25,7 @@ __docformat__ = 'restructuredtext en'
import os import os
import sys import sys
from glob import glob
from json import loads from json import loads
from urllib.request import Request, urlopen from urllib.request import Request, urlopen
from re import split, sub, compile from re import split, sub, compile
@@ -57,10 +58,17 @@ def main(argv=None):
parser = makeParser() parser = makeParser()
options, args = parser.parse_args(argv) options, args = parser.parse_args(argv)
checkOptions() checkOptions()
if len(args) != 1: if len(args) == 0:
parser.print_help() parser.print_help()
return return
outputPath = makeBook(args[0]) sources = [source for arg in args for source in glob(arg)]
if len(sources) == 0:
print('No matching files found.')
return
for source in sources:
if len(sources) > 1:
print('\nWorking on {}...'.format(source))
outputPath = makeBook(source)
return outputPath return outputPath
@@ -1257,4 +1265,4 @@ def makeMOBI(work, qtGUI=None):
makeMOBIWorkerPool.apply_async(func=makeMOBIWorker, args=(i, ), callback=makeMOBIWorkerTick) makeMOBIWorkerPool.apply_async(func=makeMOBIWorker, args=(i, ), callback=makeMOBIWorkerTick)
makeMOBIWorkerPool.close() makeMOBIWorkerPool.close()
makeMOBIWorkerPool.join() makeMOBIWorkerPool.join()
return makeMOBIWorkerOutput return makeMOBIWorkerOutput