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

Method set_info

Lib/mailbox.py:405–418  ·  view source on GitHub ↗

Set the keyed message's "info" string.

(self, key, info: str)

Source from the content-addressed store, hash-verified

403 return ''
404
405 def set_info(self, key, info: str):
406 """Set the keyed message's "info" string."""
407 if not isinstance(info, str):
408 raise TypeError(f'info must be a string: {type(info)}')
409 old_subpath = self._lookup(key)
410 new_subpath = old_subpath.split(self.colon)[0]
411 if info:
412 new_subpath += self.colon + info
413 if new_subpath == old_subpath:
414 return
415 old_path = os.path.join(self._path, old_subpath)
416 new_path = os.path.join(self._path, new_subpath)
417 os.rename(old_path, new_path)
418 self._toc[key] = new_subpath
419
420 def get_flags(self, key):
421 """Return as a string the standard flags that are set on the keyed message."""

Callers 2

set_flagsMethod · 0.95
check_infoMethod · 0.45

Calls 5

_lookupMethod · 0.95
isinstanceFunction · 0.85
splitMethod · 0.45
joinMethod · 0.45
renameMethod · 0.45

Tested by 1

check_infoMethod · 0.36