Parse command-line args in a separate function.

This commit is contained in:
Dan 2019-05-23 08:39:18 -04:00 committed by Wenzel Jakob
parent e0b8bbbce9
commit 41f29ccd9e

View File

@ -232,7 +232,7 @@ class ExtractionThread(Thread):
job_semaphore.release() job_semaphore.release()
def extract_all(args): def read_args(args):
parameters = [] parameters = []
filenames = [] filenames = []
if "-x" not in args: if "-x" not in args:
@ -277,6 +277,11 @@ def extract_all(args):
if len(filenames) == 0: if len(filenames) == 0:
raise NoFilenamesError("args parameter did not contain any filenames") raise NoFilenamesError("args parameter did not contain any filenames")
return parameters, filenames
def extract_all(args):
parameters, filenames = read_args(args)
output = [] output = []
for filename in filenames: for filename in filenames:
thr = ExtractionThread(filename, parameters, output) thr = ExtractionThread(filename, parameters, output)