diff options
Diffstat (limited to 'libbe/bug.py')
-rw-r--r-- | libbe/bug.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libbe/bug.py b/libbe/bug.py index 43974dd..89c0266 100644 --- a/libbe/bug.py +++ b/libbe/bug.py @@ -18,6 +18,7 @@ import os import os.path import errno import time +import types import xml.sax.saxutils import doctest @@ -184,6 +185,25 @@ class Bug(settings_object.SavedSettingsObject): fset=_set_time, doc="An integer version of .time_string") + def _extra_strings_check_fn(value): + "Require an iterable full of strings" + if not hasattr(value, "__iter__"): + return False + for x in value: + if type(x) not in types.StringTypes: + return False + return True + def _extra_strings_change_hook(self, old, new): + self.extra_strings.sort() # to make merging easier + self._prop_save_settings(old, new) + @_versioned_property(name="extra_strings", + doc="Space for an array of extra strings. Useful for storing state for functionality implemented purely in becommands/<some_function>.py.", + default=[], + check_fn=_extra_strings_check_fn, + change_hook=_extra_strings_change_hook, + mutable=True) + def extra_strings(): return {} + @_versioned_property(name="summary", doc="A one-line bug description") def summary(): return {} |