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

Method __init__

Lib/mailbox.py:272–290  ·  view source on GitHub ↗

Initialize a Maildir instance.

(self, dirname, factory=None, create=True)

Source from the content-addressed store, hash-verified

270 colon = ':'
271
272 def __init__(self, dirname, factory=None, create=True):
273 """Initialize a Maildir instance."""
274 Mailbox.__init__(self, dirname, factory, create)
275 self._paths = {
276 'tmp': os.path.join(self._path, 'tmp'),
277 'new': os.path.join(self._path, 'new'),
278 'cur': os.path.join(self._path, 'cur'),
279 }
280 if not os.path.exists(self._path):
281 if create:
282 os.mkdir(self._path, 0o700)
283 for path in self._paths.values():
284 os.mkdir(path, 0o700)
285 else:
286 raise NoSuchMailboxError(self._path)
287 self._toc = {}
288 self._toc_mtimes = {'cur': 0, 'new': 0}
289 self._last_read = 0 # Records last time we read cur/new
290 self._skewfactor = 0.1 # Adjust if os/fs clocks are skewing
291
292 def add(self, message):
293 """Add message and return assigned key."""

Callers

nothing calls this directly

Calls 6

NoSuchMailboxErrorClass · 0.85
__init__Method · 0.45
joinMethod · 0.45
existsMethod · 0.45
mkdirMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected