Added BugDir.extra_strings.
authorW. Trevor King <wking@drexel.edu>
Tue, 21 Jul 2009 20:20:21 +0000 (16:20 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 21 Jul 2009 20:20:21 +0000 (16:20 -0400)
libbe/bugdir.py

index 9802502d5bcb900dc5945b32221ef280315a9e9c..6e020ee784bf21f4363cd9d6aa0c7517c437fd9c 100644 (file)
@@ -228,6 +228,20 @@ settings easy.  Don't set this attribute.  Set .rcs instead, and
                 map[uuid] = None
         self._bug_map_value = map # ._bug_map_value used by @local_property
 
+    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 {}
+
     @Property
     @primed_property(primer=_bug_map_gen)
     @local_property("bug_map")