Initialize an MH instance.
(self, path, factory=None, create=True)
| 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.""" |
no test coverage detected