MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_message

Method get_message

Lib/mailbox.py:833–842  ·  view source on GitHub ↗

Return a Message representation or raise a KeyError.

(self, key)

Source from the content-addressed store, hash-verified

831 _mangle_from_ = True
832
833 def get_message(self, key):
834 """Return a Message representation or raise a KeyError."""
835 start, stop = self._lookup(key)
836 self._file.seek(start)
837 from_line = self._file.readline().replace(linesep, b'').decode('ascii')
838 string = self._file.read(stop - self._file.tell())
839 msg = self._message_factory(string.replace(linesep, b'\n'))
840 msg.set_unixfrom(from_line)
841 msg.set_from(from_line[5:])
842 return msg
843
844 def get_string(self, key, from_=False):
845 """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