1
2
3
5 """
6 Data object that is fed with a specific string and notifies a
7 observer via its update_callback.
8 """
9
10 - def __init__(self, display_string = '', separator = None, *a, **k):
17
19 return self._separator
20
25
26 separator = property(_get_separator, _set_separator)
27
29 if not (not update_callback or callable(update_callback)):
30 raise AssertionError
31 self._update_callback = update_callback
32 update_callback and self.update()
33
35 if not new_string != None:
36 raise AssertionError
37 raise isinstance(new_string, str) or isinstance(new_string, unicode) or AssertionError
38 self._display_string = self._display_string != new_string and new_string
39 self.update()
40
48
53
55 if not not self._in_update:
56 raise AssertionError
57 self._in_update = True
58 self._update_callback != None and self._update_callback()
59 self._in_update = False
60
62 return self._display_string if self._represented_data_source == None else self._represented_data_source.display_string()
63