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

Method __init__

Lib/mailbox.py:1002–1012  ·  view source on GitHub ↗

Initialize an MH instance.

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

Source from the content-addressed store, hash-verified

1000 """An MH mailbox."""
1001
1002 def __init__(self, path, factory=None, create=True):
1003 """Initialize an MH instance."""
1004 Mailbox.__init__(self, path, factory, create)
1005 if not os.path.exists(self._path):
1006 if create:
1007 os.mkdir(self._path, 0o700)
1008 os.close(os.open(os.path.join(self._path, '.mh_sequences'),
1009 os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600))
1010 else:
1011 raise NoSuchMailboxError(self._path)
1012 self._locked = False
1013
1014 def add(self, message):
1015 """Add message and return assigned key."""

Callers 11

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 6

NoSuchMailboxErrorClass · 0.85
existsMethod · 0.45
mkdirMethod · 0.45
closeMethod · 0.45
openMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected