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

Method _pre_mailbox_hook

Lib/mailbox.py:1445–1453  ·  view source on GitHub ↗

Called before writing the mailbox to file f.

(self, f)

Source from the content-addressed store, hash-verified

1443 self._file_length = self._file.tell()
1444
1445 def _pre_mailbox_hook(self, f):
1446 """Called before writing the mailbox to file f."""
1447 babyl = b'BABYL OPTIONS:' + linesep
1448 babyl += b'Version: 5' + linesep
1449 labels = self.get_labels()
1450 labels = (label.encode() for label in labels)
1451 babyl += b'Labels:' + b','.join(labels) + linesep
1452 babyl += b'\037'
1453 f.write(babyl)
1454
1455 def _pre_message_hook(self, f):
1456 """Called before writing each message to file f."""

Callers

nothing calls this directly

Calls 4

get_labelsMethod · 0.95
encodeMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected