From b6b4a8ca290c9ae95a8647b434b75a94a0d952b3 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Mon, 4 Oct 2010 20:48:23 +0200 Subject: [PATCH] Simplify the warning doc string construction and sanitize the configuration at end of option reading. --- linkchecker | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/linkchecker b/linkchecker index 3d928c4a..b554fdcd 100755 --- a/linkchecker +++ b/linkchecker @@ -188,9 +188,9 @@ none Logs nothing. Suitable for debugging or checking the exit code. Warnings = _(r"""IGNORE WARNINGS The following warnings are recognized in the 'ignorewarnings' config file entry: -""") -for tag, desc in sorted(linkcheck.checker.const.Warnings.items()): - Warnings += u" o %s\n %s\n" % (tag, desc) +""") + \ +"\n".join([u" o %s\n %s" % (tag, desc) \ + for tag, desc in sorted(linkcheck.checker.const.Warnings.items())]) def print_version (): @@ -743,6 +743,8 @@ for prefix in ("checkhtml", "checkcss"): option = "%s%s" % (prefix, suffix) if getattr(options, option) is not None: config[option] = getattr(options, option) +# now sanitize the configuration +config.sanitize() log.debug(LOG_CMDLINE, "configuration: %s", pprint.pformat(config.items())) # warn about sitemap loggers and complete output