Move lexicon status strings to class constants

This commit is contained in:
Tim Van Baak 2020-04-23 21:35:29 -07:00
parent dcf039c9de
commit 7a17b48a4d

View File

@ -8,6 +8,10 @@ from amanuensis.config import (
class LexiconModel():
PREGAME = "unstarted"
ONGOING = "ongoing"
COMPLETE = "completed"
"""Represents a lexicon in the Amanuensis config store"""
def __init__(self, root: RootConfigDirectoryContext, lid: str):
self._lid: str = lid
@ -54,7 +58,7 @@ class LexiconModel():
@property
def status(self) -> str:
if self.cfg.turn.current is None:
return "unstarted"
return LexiconModel.PREGAME
if self.cfg.turn.current > self.cfg.turn.max:
return "completed"
return "ongoing"
return LexiconModel.COMPLETE
return LexiconModel.ONGOING