mirror of
https://github.com/ciromattia/kcc
synced 2025-12-19 20:51:45 +00:00
Tweaked glob support
This commit is contained in:
@@ -25,6 +25,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from copy import copy
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from json import loads
|
from json import loads
|
||||||
from urllib.request import Request, urlopen
|
from urllib.request import Request, urlopen
|
||||||
@@ -56,18 +57,20 @@ from . import dualmetafix
|
|||||||
def main(argv=None):
|
def main(argv=None):
|
||||||
global options
|
global options
|
||||||
parser = makeParser()
|
parser = makeParser()
|
||||||
options, args = parser.parse_args(argv)
|
optionstemplate, args = parser.parse_args(argv)
|
||||||
checkOptions()
|
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
return
|
return
|
||||||
sources = [source for arg in args for source in glob(arg)]
|
sources = set([source for arg in args for source in glob(arg)])
|
||||||
|
outputPath = []
|
||||||
if len(sources) == 0:
|
if len(sources) == 0:
|
||||||
print('No matching files found.')
|
print('No matching files found.')
|
||||||
return
|
return
|
||||||
for source in sources:
|
for source in sources:
|
||||||
|
options = copy(optionstemplate)
|
||||||
|
checkOptions()
|
||||||
if len(sources) > 1:
|
if len(sources) > 1:
|
||||||
print('\nWorking on {}...'.format(source))
|
print('\nWorking on ' + source)
|
||||||
outputPath = makeBook(source)
|
outputPath = makeBook(source)
|
||||||
return outputPath
|
return outputPath
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user