diff options
author | Martin Sivak <msivak@redhat.com> | 2010-08-24 16:17:10 +0200 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2010-08-24 16:17:10 +0200 |
commit | 05b78d2a5c4101e552954645df018b21aa32b8fb (patch) | |
tree | 88ce337f89088b04fd18e1a38d4fc1c7d2924b21 /pyfirstaidkit/reporting.py | |
parent | f273fe2502adf3023d816c9f495fad12140c9ddb (diff) | |
download | firstaidkit-05b78d2a5c4101e552954645df018b21aa32b8fb.tar.gz firstaidkit-05b78d2a5c4101e552954645df018b21aa32b8fb.tar.xz firstaidkit-05b78d2a5c4101e552954645df018b21aa32b8fb.zip |
Improve the user experience
- Expert tab is hidden by default
- Config dialog checks the format of entered values
- Example plugin for dialogs updated
Diffstat (limited to 'pyfirstaidkit/reporting.py')
-rw-r--r-- | pyfirstaidkit/reporting.py | 7 |
1 files changed, 5 insertions, 2 deletions
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. |