diff options
author | Joris | 2020-06-01 09:11:02 +0200 |
---|---|---|
committer | Joris | 2020-06-01 09:11:02 +0200 |
commit | 3844f76d18e376777ca4d7c124df6d6b4896a361 (patch) | |
tree | 425a2380f960f81f929b1b1b6e860bd42626127d /src/model/status.py | |
parent | adfab777568215d3c72facf07b734c1ff6046d78 (diff) |
Separate tasks panel on status
Diffstat (limited to 'src/model/status.py')
-rw-r--r-- | src/model/status.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/model/status.py b/src/model/status.py new file mode 100644 index 0000000..6881e0a --- /dev/null +++ b/src/model/status.py @@ -0,0 +1,30 @@ +from enum import IntEnum +from typing import Optional + +class Status(IntEnum): + READY = 0 + WAITING = 1 + MAYBE = 2 + +values = [ + Status.READY, + Status.WAITING, + Status.MAYBE] + +def format(status: Status) -> str: + if status == Status.READY: + return "Ready" + elif status == Status.WAITING: + return "Waiting" + elif status == Status.MAYBE: + return "Maybe" + +def parse(string: str) -> Optional[Status]: + if string == "Ready": + return Status.READY + elif string == "Waiting": + return Status.WAITING + elif string == "Maybe": + return Status.MAYBE + else: + return None |