diff options
author | Lisa Junger <ljunger@thoughtworks.com> | 2014-10-10 18:16:34 +0200 |
---|---|---|
committer | Lisa Junger <ljunger@thoughtworks.com> | 2014-10-13 14:38:28 +0200 |
commit | 456019b85f9efbc50ccf932e8081641facaf8fae (patch) | |
tree | 141273ce68969febf176d95ad1fb0408b26a5222 /service/pixelated/adapter/status.py | |
parent | c2b308ce34eadd5ec2c841da03e111ea107972d8 (diff) |
#104 Implemented mark single mail as unread
Diffstat (limited to 'service/pixelated/adapter/status.py')
-rw-r--r-- | service/pixelated/adapter/status.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/service/pixelated/adapter/status.py b/service/pixelated/adapter/status.py index cd11a46f..3807359c 100644 --- a/service/pixelated/adapter/status.py +++ b/service/pixelated/adapter/status.py @@ -37,6 +37,11 @@ class Status: def from_flags(cls, flags): return set(cls.from_flag(flag) for flag in flags if flag in cls.LEAP_FLAGS_STATUSES.keys()) + @classmethod + def to_flags(cls, statuses): + statuses_to_flags = dict(zip(cls.LEAP_FLAGS_STATUSES.values(), cls.LEAP_FLAGS_STATUSES.keys())) + return [statuses_to_flags[status] for status in statuses] + def __init__(self, name): self.name = name self.ident = name.__hash__() |