From d9b369864d04387b366caa9769ffb198e644e503 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 25 Sep 2016 19:02:19 +0200 Subject: [PATCH] Reimplement `generateDefaultOptions()` by simply calling `sanitizeOptions()` --- scour/scour.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/scour/scour.py b/scour/scour.py index e26e09d..23be0c5 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -3710,16 +3710,10 @@ def parse_args(args=None, ignore_additional_args=False): return options +# this function was replaced by 'sanitizeOptions()' and is only kept for backwards compatibility +# TODO: delete this at some point or continue to keep it around? def generateDefaultOptions(): - # FIXME: clean up this mess/hack and refactor arg parsing to argparse - class Struct: - - def __init__(self, **entries): - self.__dict__.update(entries) - - d = parse_args(args=[], ignore_additional_args=True).__dict__.copy() - - return Struct(**d) + return sanitizeOptions() # sanitizes options by updating attributes in a set of defaults options while discarding unknown attributes