49
49
raise NotImplementedError
52
def del_data(self, name):
53
""" Deletes the array specified by *name*, or raises a KeyError if
54
the named array does not exist.
56
If the instance is not writable, then this must do nothing.
59
raise NotImplementedError
52
61
def set_data(self, name, new_data, generate_name=False):
54
Returns the new data's name.
56
If **writable** is True, then this method sets the data associated
57
with the given name to the new value.
59
If **writable** is False, then this method must do nothing.
61
If *generate_name* is True, then the data source must
62
create a new name to bind to the data, and return it.
64
If the name does not exist, then the method attaches a new data entry
68
raise NotImplementedError
62
""" Sets the specified array as the value for either the specified
63
name or a generated name.
65
If the instance's `writable` attribute is True, then this method sets
66
the data associated with the given name to the new value, otherwise it
72
The name of the array whose value is to be set.
74
The array to set as the value of *name*.
75
generate_name : Boolean
76
If True, a unique name of the form 'seriesN' is created for the
77
array, and is used in place of *name*. The 'N' in 'seriesN' is
78
one greater the largest N already used.
82
The name under which the array was set.
85
raise NotImplementedError
88
def update_data(self, *args, **kwargs):
90
Update a set of data values, firing only one data_changed event.
92
This function has the same signature as the dictionary update()
96
raise NotImplementedError
71
98
def set_selection(self, name, selection):
72
99
""" Sets the selection on the specified data.
83
110
array named by *name* is selected.
85
112
raise NotImplementedError
114
#------------------------------------------------------------------------
115
# Dictionary Interface
116
#------------------------------------------------------------------------
118
def __getitem__(self, name):
119
return self.arrays.get(name, None)
121
def __setitem__(self, name, value):
122
return self.set_data(name, value)
124
def __delitem__(self, name):
125
return self.del_data(name)
127
def update(self, *args, **kwargs):
128
self.update_data(*args, **kwargs)