Create a folder and return a Maildir instance representing it.
(self, folder)
| 449 | create=False) |
| 450 | |
| 451 | def add_folder(self, folder): |
| 452 | """Create a folder and return a Maildir instance representing it.""" |
| 453 | path = os.path.join(self._path, '.' + folder) |
| 454 | result = Maildir(path, factory=self._factory) |
| 455 | maildirfolder_path = os.path.join(path, 'maildirfolder') |
| 456 | if not os.path.exists(maildirfolder_path): |
| 457 | os.close(os.open(maildirfolder_path, os.O_CREAT | os.O_WRONLY, |
| 458 | 0o666)) |
| 459 | return result |
| 460 | |
| 461 | def remove_folder(self, folder): |
| 462 | """Delete the named folder, which must be empty.""" |