diff options
author | Chris Ball <cjb@laptop.org> | 2009-06-25 09:53:39 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2009-06-25 09:53:39 -0400 |
commit | ae52bd5946df9c0d59be43824b20d33819891f93 (patch) | |
tree | c4579ec93a80f5e93b4258e8771ae39405ce9ba7 /libbe/bug.py | |
parent | 1f746ca3f2f2745bfeae998186b4a427776359a2 (diff) | |
parent | eeaf13d7d9c5e6fcad4689c988d4fc1806426d3f (diff) | |
download | bugseverywhere-ae52bd5946df9c0d59be43824b20d33819891f93.tar.gz |
Merge with W. Trevor King's tree.
Diffstat (limited to 'libbe/bug.py')
-rw-r--r-- | libbe/bug.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libbe/bug.py b/libbe/bug.py index 43974dd..7418933 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,27 @@ 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 value == settings_object.EMPTY: + return True + elif 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 {} |