From 3844f76d18e376777ca4d7c124df6d6b4896a361 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 1 Jun 2020 09:11:02 +0200 Subject: Separate tasks panel on status --- src/model/difficulty.py | 2 +- src/model/status.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/model/status.py (limited to 'src/model') diff --git a/src/model/difficulty.py b/src/model/difficulty.py index e38f19b..526cdb9 100644 --- a/src/model/difficulty.py +++ b/src/model/difficulty.py @@ -23,7 +23,7 @@ def parse(string: str) -> Optional[Difficulty]: if string == "Easy": return Difficulty.EASY elif string == "Normal": - return Difficulty.MIDDLE + return Difficulty.NORMAL elif string == "Hard": return Difficulty.HARD else: 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 -- cgit v1.2.3