]> git.armaanb.net Git - lightcards.git/blobdiff - lightcards/display.py
Handle exceptions and exit codes better
[lightcards.git] / lightcards / display.py
index 47399828e7361253ba75ea00b28151b178d45e07..8340c272cdc3349bdd30d4d9460108bed3c5217a 100644 (file)
@@ -19,6 +19,13 @@ def panel_create(x, y):
     return (win, panel)
 
 
+class CursesError(BaseException):
+    def __init__(self, message="lightcards: Curses error!"):
+        self.message = message
+        print(self.message)
+        sys.exit(3)
+
+
 class Help:
     def __init__(self, outer, mlines=21, mcols=52):
         """Initialize help screen"""