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

Method get_message

Lib/mailbox.py:373–386  ·  view source on GitHub ↗

Return a Message representation or raise a KeyError.

(self, key)

Source from the content-addressed store, hash-verified

371 os.rename(tmp_path, new_path)
372
373 def get_message(self, key):
374 """Return a Message representation or raise a KeyError."""
375 subpath = self._lookup(key)
376 with open(os.path.join(self._path, subpath), 'rb') as f:
377 if self._factory:
378 msg = self._factory(f)
379 else:
380 msg = MaildirMessage(f)
381 subdir, name = os.path.split(subpath)
382 msg.set_subdir(subdir)
383 if self.colon in name:
384 msg.set_info(name.split(self.colon)[-1])
385 msg.set_date(os.path.getmtime(os.path.join(self._path, subpath)))
386 return msg
387
388 def get_bytes(self, key):
389 """Return a bytes representation or raise a KeyError."""

Callers 1

Calls 9

_lookupMethod · 0.95
set_subdirMethod · 0.95
set_infoMethod · 0.95
set_dateMethod · 0.95
MaildirMessageClass · 0.85
_factoryMethod · 0.80
openFunction · 0.70
joinMethod · 0.45
splitMethod · 0.45

Tested by 1