MCPcopy Index your code
hub / github.com/python/cpython / add_folder

Method add_folder

Lib/mailbox.py:508–516  ·  view source on GitHub ↗

Create a folder and return a Maildir instance representing it.

(self, folder)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 5

MaildirClass · 0.85
joinMethod · 0.45
existsMethod · 0.45
closeMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected