MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / get_message

Method get_message

tools/python-3.11.9-amd64/Lib/mailbox.py:777–786  ·  view source on GitHub ↗

Return a Message representation or raise a KeyError.

(self, key)

Source from the content-addressed store, hash-verified

775 _mangle_from_ = True
776
777 def get_message(self, key):
778 """Return a Message representation or raise a KeyError."""
779 start, stop = self._lookup(key)
780 self._file.seek(start)
781 from_line = self._file.readline().replace(linesep, b'').decode('ascii')
782 string = self._file.read(stop - self._file.tell())
783 msg = self._message_factory(string.replace(linesep, b'\n'))
784 msg.set_unixfrom(from_line)
785 msg.set_from(from_line[5:])
786 return msg
787
788 def get_string(self, key, from_=False):
789 """Return a string representation or raise a KeyError."""

Callers

nothing calls this directly

Calls 9

set_unixfromMethod · 0.80
set_fromMethod · 0.80
_lookupMethod · 0.45
seekMethod · 0.45
decodeMethod · 0.45
replaceMethod · 0.45
readlineMethod · 0.45
readMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected