Initialize an MH instance.
(self, path, factory=None, create=True)
| 937 | """An MH mailbox.""" |
| 938 | |
| 939 | def __init__(self, path, factory=None, create=True): |
| 940 | """Initialize an MH instance.""" |
| 941 | Mailbox.__init__(self, path, factory, create) |
| 942 | if not os.path.exists(self._path): |
| 943 | if create: |
| 944 | os.mkdir(self._path, 0o700) |
| 945 | os.close(os.open(os.path.join(self._path, '.mh_sequences'), |
| 946 | os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)) |
| 947 | else: |
| 948 | raise NoSuchMailboxError(self._path) |
| 949 | self._locked = False |
| 950 | |
| 951 | def add(self, message): |
| 952 | """Add message and return assigned key.""" |
no test coverage detected