Create a folder and return a Maildir instance representing it.
(self, folder)
| 499 | create=False) |
| 500 | |
| 501 | def add_folder(self, folder): |
| 502 | """Create a folder and return a Maildir instance representing it.""" |
| 503 | path = os.path.join(self._path, '.' + folder) |
| 504 | result = Maildir(path, factory=self._factory) |
| 505 | maildirfolder_path = os.path.join(path, 'maildirfolder') |
| 506 | if not os.path.exists(maildirfolder_path): |
| 507 | os.close(os.open(maildirfolder_path, os.O_CREAT | os.O_WRONLY, |
| 508 | 0o666)) |
| 509 | return result |
| 510 | |
| 511 | def remove_folder(self, folder): |
| 512 | """Delete the named folder, which must be empty.""" |