Enable the '+' operator for Tracks. Notes, notes as string, NoteContainers and Bars accepted.
(self, value)
| 175 | return self |
| 176 | |
| 177 | def __add__(self, value): |
| 178 | """Enable the '+' operator for Tracks. |
| 179 | |
| 180 | Notes, notes as string, NoteContainers and Bars accepted. |
| 181 | """ |
| 182 | if hasattr(value, "bar"): |
| 183 | return self.add_bar(value) |
| 184 | elif hasattr(value, "notes"): |
| 185 | return self.add_notes(value) |
| 186 | elif hasattr(value, "name") or isinstance(value, six.string_types): |
| 187 | return self.add_notes(value) |
| 188 | |
| 189 | def test_integrity(self): |
| 190 | """Test whether all but the last Bars contained in this track are |