diff options
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__() |