From 098dede12caf751bc72691d61ea78ebbf756bca1 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 20 Mar 2014 20:46:58 +0100 Subject: [PATCH] Fix warningregex setting in GUI. --- doc/changelog.txt | 2 ++ linkcheck/gui/__init__.py | 12 +++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index 789d4392..555c0fb9 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -25,6 +25,8 @@ Fixes: - checking: Fix assertion in external link checking. - checking: Fix SSL errors on Windows. Closes: GH bug #471 +- gui: Fix warning regex settings. + Closes: GH bug #485 9.0 "The Wolf of Wall Street" (released 3.3.2014) diff --git a/linkcheck/gui/__init__.py b/linkcheck/gui/__init__.py index 0e1699fa..824d5b61 100644 --- a/linkcheck/gui/__init__.py +++ b/linkcheck/gui/__init__.py @@ -262,13 +262,9 @@ class LinkCheckerMain (QtGui.QMainWindow, Ui_MainWindow): if data["warninglines"]: lines = data["warninglines"].splitlines() pattern = warninglines2regex(lines) - try: - ro = re.compile(pattern) - self.backup_config("warningregex", ro) - except re.error as err: - msg = _("Invalid regular expression %r: %s" % (pattern, err)) - self.set_statusmsg(msg) - + args = dict(warningregex=pattern) + self.backup_config("enabledplugins", ["RegexCheck"]) + self.config["RegexCheck"] = args # set ignore patterns ignorepats = data["ignorelines"].strip() if ignorepats: @@ -281,6 +277,8 @@ class LinkCheckerMain (QtGui.QMainWindow, Ui_MainWindow): except re.error as err: msg = _("Invalid regular expression %r: %s" % (pat, err)) self.set_statusmsg(msg) + # make sure the configuration is sane + self.config.sanitize() def backup_config (self, key, value=None): """Backup config key if not already done and set given value."""