MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _pre_mailbox_hook

Method _pre_mailbox_hook

tools/python-3.11.9-amd64/Lib/mailbox.py:1364–1372  ·  view source on GitHub ↗

Called before writing the mailbox to file f.

(self, f)

Source from the content-addressed store, hash-verified

1362 self._file_length = self._file.tell()
1363
1364 def _pre_mailbox_hook(self, f):
1365 """Called before writing the mailbox to file f."""
1366 babyl = b'BABYL OPTIONS:' + linesep
1367 babyl += b'Version: 5' + linesep
1368 labels = self.get_labels()
1369 labels = (label.encode() for label in labels)
1370 babyl += b'Labels:' + b','.join(labels) + linesep
1371 babyl += b'\037'
1372 f.write(babyl)
1373
1374 def _pre_message_hook(self, f):
1375 """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