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