def clear_mailbox(cls, directory): """ Method clears mailbox by removing symlinks. Args: directory (str): Path to directory for clearing the mailbox """ mailbox = Maildir(directory) mailbox.clear()
def empty_dir(directory): box = Maildir(directory) box.clear()
def process(gen, output): box = Maildir(output) box.clear() for filename in gen: os.symlink(filename, join(box._path, "cur", basename(filename)))