From 24c32643c1a3ae749f7eae5f125fa6712599e2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Mon, 10 Nov 2014 19:33:03 +0100 Subject: [PATCH] Tweaked glob support --- kcc/comic2ebook.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 659428e..16de45d 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -25,6 +25,7 @@ __docformat__ = 'restructuredtext en' import os import sys +from copy import copy from glob import glob from json import loads from urllib.request import Request, urlopen @@ -56,18 +57,20 @@ from . import dualmetafix def main(argv=None): global options parser = makeParser() - options, args = parser.parse_args(argv) - checkOptions() + optionstemplate, args = parser.parse_args(argv) if len(args) == 0: parser.print_help() 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: print('No matching files found.') return for source in sources: + options = copy(optionstemplate) + checkOptions() if len(sources) > 1: - print('\nWorking on {}...'.format(source)) + print('\nWorking on ' + source) outputPath = makeBook(source) return outputPath