diff options
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/adapter/pixelated_mailbox.py | 3 | ||||
-rw-r--r-- | service/pixelated/adapter/pixelated_mailboxes.py | 5 | ||||
-rw-r--r-- | service/pixelated/user_agent.py | 4 |
3 files changed, 3 insertions, 9 deletions
diff --git a/service/pixelated/adapter/pixelated_mailbox.py b/service/pixelated/adapter/pixelated_mailbox.py index ecd83d6e..739bc215 100644 --- a/service/pixelated/adapter/pixelated_mailbox.py +++ b/service/pixelated/adapter/pixelated_mailbox.py @@ -1,4 +1,3 @@ - # # Copyright (c) 2014 ThoughtWorks, Inc. # @@ -43,7 +42,7 @@ class PixelatedMailbox: return mails def mails_by_tags(self, tags): - if 'all' in map(str, tags): + if 'all' in tags: return self.mails() return [mail for mail in self.mails() if len(mail.tags.intersection(tags)) > 0] diff --git a/service/pixelated/adapter/pixelated_mailboxes.py b/service/pixelated/adapter/pixelated_mailboxes.py index 1125c137..652080ca 100644 --- a/service/pixelated/adapter/pixelated_mailboxes.py +++ b/service/pixelated/adapter/pixelated_mailboxes.py @@ -1,4 +1,3 @@ -from pixelated.adapter.tag import Tag from pixelated.adapter.pixelated_mailbox import PixelatedMailbox @@ -16,11 +15,9 @@ class PixelatedMailBoxes(): self.account.mailboxes] def mails_by_tag(self, query_tags): - tags = map(Tag, query_tags) - mails = [] for mailbox in self.mailboxes: - mails.extend(mailbox.mails_by_tags(tags)) + mails.extend(mailbox.mails_by_tags(query_tags)) return mails diff --git a/service/pixelated/user_agent.py b/service/pixelated/user_agent.py index 42dc97fd..33b43a3e 100644 --- a/service/pixelated/user_agent.py +++ b/service/pixelated/user_agent.py @@ -16,7 +16,6 @@ import json import argparse import os -import sys import os.path from flask import Flask from flask import request @@ -115,8 +114,7 @@ def mail(mail_id): def mail_tags(mail_id): new_tags = request.get_json()['newtags'] tags = mail_service.update_tags(mail_id, new_tags) - tag_names = [tag.name for tag in tags] - return respond_json(tag_names) + return respond_json(tags) @app.route('/mail/<mail_id>/read', methods=['POST']) |