From: W. Trevor King Date: Tue, 21 Jul 2009 20:21:42 +0000 (-0400) Subject: I'll add Comment.extra_strings too, while I'm at it. X-Git-Tag: 1.0.0~63^2~7^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2d29e2ae07322371c597ccac564e481a926a87ea;p=be.git I'll add Comment.extra_strings too, while I'm at it. --- diff --git a/libbe/comment.py b/libbe/comment.py index d19953b..3249e8b 100644 --- a/libbe/comment.py +++ b/libbe/comment.py @@ -218,6 +218,20 @@ class Comment(Tree, settings_object.SavedSettingsObject): @doc_property(doc="A revision control system instance.") def rcs(): return {} + def _extra_strings_check_fn(value): + return utility.iterable_full_of_strings(value, \ + alternative=settings_object.EMPTY) + 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/.py.", + default=[], + check_fn=_extra_strings_check_fn, + change_hook=_extra_strings_change_hook, + mutable=True) + def extra_strings(): return {} + def __init__(self, bug=None, uuid=None, from_disk=False, in_reply_to=None, body=None): """