diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2015-06-04 17:51:00 -0300 |
---|---|---|
committer | Victor Shyba <victor.shyba@gmail.com> | 2015-06-04 17:51:10 -0300 |
commit | b708aeb18603d859aae90b54b9582681b880b5de (patch) | |
tree | f200481460c517d91015832524db0d0342ca3079 /service/pixelated/adapter | |
parent | 0a5104c2edf7ade2a5d7f69aaf7bd55da19a406b (diff) |
refactor unassigned list comprehension
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r-- | service/pixelated/adapter/soledad/soledad_facade_mixin.py | 4 | ||||
-rw-r--r-- | service/pixelated/adapter/soledad/soledad_writer_mixin.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/service/pixelated/adapter/soledad/soledad_facade_mixin.py b/service/pixelated/adapter/soledad/soledad_facade_mixin.py index 761ef1e2..2a50b17d 100644 --- a/service/pixelated/adapter/soledad/soledad_facade_mixin.py +++ b/service/pixelated/adapter/soledad/soledad_facade_mixin.py @@ -47,6 +47,10 @@ class SoledadDbFacadeMixin(object): def create_doc(self, doc): return self.soledad.create_doc(doc) + def create_docs(self, docs): + for doc in docs: + self.create_doc(doc) + def delete_doc(self, doc): return self.soledad.delete_doc(doc) diff --git a/service/pixelated/adapter/soledad/soledad_writer_mixin.py b/service/pixelated/adapter/soledad/soledad_writer_mixin.py index 8e7a46f2..b0d21b93 100644 --- a/service/pixelated/adapter/soledad/soledad_writer_mixin.py +++ b/service/pixelated/adapter/soledad/soledad_writer_mixin.py @@ -33,8 +33,7 @@ class SoledadWriterMixin(SoledadDbFacadeMixin, object): def create_mail(self, mail, mailbox_name): mbox_doc = self.get_mbox(mailbox_name)[0] uid = self.get_lastuid(mbox_doc) - - [self.create_doc(doc) for doc in mail.get_for_save(next_uid=uid, mailbox=mailbox_name)] + self.create_docs(mail.get_for_save(next_uid=uid, mailbox=mailbox_name)) mbox_doc.content['lastuid'] = uid + 1 self.put_doc(mbox_doc) |