From 05b78d2a5c4101e552954645df018b21aa32b8fb Mon Sep 17 00:00:00 2001 From: Martin Sivak Date: Tue, 24 Aug 2010 16:17:10 +0200 Subject: Improve the user experience - Expert tab is hidden by default - Config dialog checks the format of entered values - Example plugin for dialogs updated --- pyfirstaidkit/reporting.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pyfirstaidkit/reporting.py') diff --git a/pyfirstaidkit/reporting.py b/pyfirstaidkit/reporting.py index 9151db9..21a4b45 100644 --- a/pyfirstaidkit/reporting.py +++ b/pyfirstaidkit/reporting.py @@ -19,6 +19,7 @@ import Queue import logging import thread import weakref +import re from errors import * @@ -77,14 +78,16 @@ class Question(object): class ConfigQuestion(Question): """A question that allows list of configurable variables - Each item is a tuple (id, title, value, tooltip)""" + Each item is a tuple (id, title, value, + tooltip, regexp_validator, validator_error_msg)""" def __init__(self, title, description, items): super(ConfigQuestion, self).__init__(title) assert len(items) > 0 self.title = title self.description = description - self.items = items + self.items = map(lambda x: (x[0], x[1], x[2], x[3], + re.compile("^"+x[4]+"$"), x[5]), items) class ChoiceQuestion(Question): """A question that offers multiple options. -- cgit