summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/services/tag_service.py
diff options
context:
space:
mode:
authorBruno Wagner & Victor Shyba <bwgpro+victor.shyba@gmail.com>2015-02-27 20:14:03 -0300
committerPixpoa pairing <pixpoapairing@pixelated-project.org>2015-02-27 20:14:03 -0300
commitb39dd32f852d8ee6ed088c0d576d239194ccf6e5 (patch)
tree7aad814340f6cafc7b2e5c86be4b4373503ee67f /service/pixelated/adapter/services/tag_service.py
parentb0084ec7184b2183d1ccabe1a0e017473e7a2892 (diff)
Refactored out tag service and replaced mail normalization with built-in parseaddr
Also made some minor fixes based on pylint output
Diffstat (limited to 'service/pixelated/adapter/services/tag_service.py')
-rw-r--r--service/pixelated/adapter/services/tag_service.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/service/pixelated/adapter/services/tag_service.py b/service/pixelated/adapter/services/tag_service.py
index 601392bb..c51da625 100644
--- a/service/pixelated/adapter/services/tag_service.py
+++ b/service/pixelated/adapter/services/tag_service.py
@@ -15,13 +15,9 @@
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
from pixelated.adapter.model.tag import Tag
+SPECIAL_TAGS = {Tag('inbox', True), Tag('sent', True), Tag('drafts', True), Tag('trash', True), Tag('ALL', True)}
-class TagService:
- instance = None
- SPECIAL_TAGS = {Tag('inbox', True), Tag('sent', True), Tag('drafts', True), Tag('trash', True), Tag('ALL', True)}
-
- @classmethod
- def extract_reserved(cls, tags):
- tags = map(lambda tag: tag.lower(), tags)
- return {tag.name for tag in cls.SPECIAL_TAGS if tag.name in tags}
+def extract_reserved_tags(tags):
+ tags = [tag.lower() for tag in tags]
+ return {tag.name for tag in SPECIAL_TAGS if tag.name in tags}