From 7a17b48a4d5f0083ff27232c034debbdc44ea0fb Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Thu, 23 Apr 2020 21:35:29 -0700 Subject: [PATCH] Move lexicon status strings to class constants --- amanuensis/models/lexicon.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/amanuensis/models/lexicon.py b/amanuensis/models/lexicon.py index c5cc3bb..43a270e 100644 --- a/amanuensis/models/lexicon.py +++ b/amanuensis/models/lexicon.py @@ -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