diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-07-31 06:46:57 +0000 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:30 +0200 |
commit | 3d79c0d150300d4f59531c8610f85f3927b085bc (patch) | |
tree | ebd85b012dd202010f120b7f38a0525c26081be3 /service/pixelated | |
parent | 1074ae5256ee296ec2efe5407a330a933e2e3b78 (diff) |
Adapted maintenace.load_mails to new data model.
- Issue #420
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/maintenance.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/service/pixelated/maintenance.py b/service/pixelated/maintenance.py index bffc272f..fd81f8a8 100644 --- a/service/pixelated/maintenance.py +++ b/service/pixelated/maintenance.py @@ -119,7 +119,7 @@ def is_keep_file(mail): @defer.inlineCallbacks def add_mail_folder(store, maildir, folder_name, deferreds): - store.add_mailbox(folder_name) + yield store.add_mailbox(folder_name) for mail in maildir: if is_keep_file(mail): @@ -144,12 +144,13 @@ def load_mails(args, mail_paths): for path in mail_paths: maildir = Maildir(path, factory=None) - add_mail_folder(store, maildir, 'INBOX', deferreds) + yield add_mail_folder(store, maildir, 'INBOX', deferreds) for mail_folder_name in maildir.list_folders(): mail_folder = maildir.get_folder(mail_folder_name) - add_mail_folder(store, mail_folder, mail_folder_name, deferreds) + yield add_mail_folder(store, mail_folder, mail_folder_name, deferreds) + + yield defer.gatherResults(deferreds, consumeErrors=True) - yield defer.DeferredList(deferreds) defer.returnValue(args) |