MCPcopy Index your code
hub / github.com/python-openxml/python-docx / __str__

Method __str__

src/docx/image/jpeg.py:72–89  ·  view source on GitHub ↗

Returns a tabular listing of the markers in this instance, which can be handy for debugging and perhaps other uses.

(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected