Enable the use of [] = notation on Bars. The value should be a NoteContainer, or a string/list/Note understood by the NoteContainer.
(self, index, value)
| 227 | return self.bar[index] |
| 228 | |
| 229 | def __setitem__(self, index, value): |
| 230 | """Enable the use of [] = notation on Bars. |
| 231 | |
| 232 | The value should be a NoteContainer, or a string/list/Note |
| 233 | understood by the NoteContainer. |
| 234 | """ |
| 235 | if hasattr(value, "notes"): |
| 236 | pass |
| 237 | elif hasattr(value, "name"): |
| 238 | value = NoteContainer(value) |
| 239 | elif isinstance(value, six.string_types): |
| 240 | value = NoteContainer(value) |
| 241 | elif isinstance(value, list): |
| 242 | res = NoteContainer() |
| 243 | for x in value: |
| 244 | res + x |
| 245 | value = res |
| 246 | self.bar[index][2] = value |
| 247 | |
| 248 | def __repr__(self): |
| 249 | """Enable str() and repr() for Bars.""" |
nothing calls this directly
no test coverage detected