MCPcopy Index your code
hub / github.com/python/cpython / set_info

Method set_info

Lib/mailbox.py:412–425  ·  view source on GitHub ↗

Set the keyed message's "info" string.

(self, key, info: str)

Source from the content-addressed store, hash-verified

410 return ''
411
412 def set_info(self, key, info: str):
413 """Set the keyed message's "info" string."""
414 if not isinstance(info, str):
415 raise TypeError(f'info must be a string: {type(info)}')
416 old_subpath = self._lookup(key)
417 new_subpath = old_subpath.split(self.colon)[0]
418 if info:
419 new_subpath += self.colon + info
420 if new_subpath == old_subpath:
421 return
422 old_path = os.path.join(self._path, old_subpath)
423 new_path = os.path.join(self._path, new_subpath)
424 os.rename(old_path, new_path)
425 self._toc[key] = new_subpath
426
427 def get_flags(self, key):
428 """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 4

_lookupMethod · 0.95
splitMethod · 0.45
joinMethod · 0.45
renameMethod · 0.45

Tested by 1

check_infoMethod · 0.36