diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2015-03-18 18:26:11 -0300 |
---|---|---|
committer | Victor Shyba <victor.shyba@gmail.com> | 2015-03-18 18:26:11 -0300 |
commit | 47cd13c4be7f330dfbaab7231e408f76346838c7 (patch) | |
tree | aef63a04ea64ce1395d2687acf238bb617a7c6e9 | |
parent | 058e9ce738856479320c1a9ce1131498ddb4fd87 (diff) |
making map and filter explicit
-rw-r--r-- | service/pixelated/adapter/services/mail_service.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/service/pixelated/adapter/services/mail_service.py b/service/pixelated/adapter/services/mail_service.py index 2b347c12..03889f82 100644 --- a/service/pixelated/adapter/services/mail_service.py +++ b/service/pixelated/adapter/services/mail_service.py @@ -46,16 +46,16 @@ class MailService(object): return mail def _filter_white_space_tags(self, tags): - return filter(bool, map(lambda e: e.strip(), tags)) + return [tag.strip() for tag in tags if not tag.isspace()] def _favor_existing_tags_casing(self, new_tags): - current_tags = map(lambda tag: tag['name'], self.search_engine.tags(query='', skip_default_tags=True)) - current_tags_lower = map(lambda tag: tag.lower(), current_tags) + current_tags = [tag['name'] for tag in self.search_engine.tags(query='', skip_default_tags=True)] + current_tags_lower = [tag.lower() for tag in current_tags] def _use_current_casing(new_tag_lower): return current_tags[current_tags_lower.index(new_tag_lower)] - return map(lambda new_tag: _use_current_casing(new_tag.lower()) if new_tag.lower() in current_tags_lower else new_tag, new_tags) + return [_use_current_casing(new_tag.lower()) if new_tag.lower() in current_tags_lower else new_tag for new_tag in new_tags] def mail(self, mail_id): return self.querier.mail(mail_id) |