Returns a tabular listing of the markers in this instance, which can be handy for debugging and perhaps other uses.
(self)
| 70 | self._markers = list(markers) |
| 71 | |
| 72 | def __str__(self): # pragma: no cover |
| 73 | """Returns a tabular listing of the markers in this instance, which can be handy |
| 74 | for debugging and perhaps other uses.""" |
| 75 | header = " offset seglen mc name\n======= ====== == =====" |
| 76 | tmpl = "%7d %6d %02X %s" |
| 77 | rows = [] |
| 78 | for marker in self._markers: |
| 79 | rows.append( |
| 80 | tmpl |
| 81 | % ( |
| 82 | marker.offset, |
| 83 | marker.segment_length, |
| 84 | ord(marker.marker_code), |
| 85 | marker.name, |
| 86 | ) |
| 87 | ) |
| 88 | lines = [header] + rows |
| 89 | return "\n".join(lines) |
| 90 | |
| 91 | @classmethod |
| 92 | def from_stream(cls, stream): |