From 50f9410c022dcd31810a8a3ea4385f5d615d3348 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 12 Jan 2021 15:30:03 +0000 Subject: [PATCH] config: Add class member and methods for signalling/checking shutdown status --- config.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config.py b/config.py index 2a54ec57..258b7c25 100644 --- a/config.py +++ b/config.py @@ -117,8 +117,16 @@ class AbstractConfig(abc.ABC): identifier: str def __init__(self) -> None: + self.in_shutdown = False # Is the application currently shutting down ? self.home = pathlib.Path.home() + def set_shutdown(self): + self.in_shutdown = True + + @property + def shutting_down(self) -> bool: + return self.in_shutdown + @property def app_dir_str(self) -> str: """Return a string version of app_dir."""