aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-21 16:21:42 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-21 16:21:42 -0400
commit2d29e2ae07322371c597ccac564e481a926a87ea (patch)
tree7f313f02de1ae8c91ce481575dbea29a54536169 /libbe
parent571a8e73c7e332d2c7ab2cc5bca78277aed367ca (diff)
downloadbugseverywhere-2d29e2ae07322371c597ccac564e481a926a87ea.tar.gz
I'll add Comment.extra_strings too, while I'm at it.
Diffstat (limited to 'libbe')
-rw-r--r--libbe/comment.py14
1 files changed, 14 insertions, 0 deletions
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/<some_function>.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):
"""