From: Armaan Bhojwani Date: Sun, 31 Jan 2021 14:10:10 +0000 (-0500) Subject: Clean up code X-Git-Tag: v0.2.0~2 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=6202759d55c4cc6b67d67d0c9fca4c5bac620989 Clean up code --- diff --git a/lightcards/display.py b/lightcards/display.py index 84f3d57..0ce321f 100755 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -3,6 +3,7 @@ import curses from random import shuffle +import sys def disp_bar(stdscr, stack, headers, obj): @@ -29,6 +30,7 @@ def disp_bar(stdscr, stack, headers, obj): def disp_menu(stdscr, stack, headers, idx): + stdscr.clear() curses.init_pair(1, curses.COLOR_CYAN, 0) curses.init_pair(2, curses.COLOR_RED, 0) stdscr.addstr("Good job, you've completed a round!\n\n", @@ -42,7 +44,7 @@ def disp_menu(stdscr, stack, headers, idx): while True: key = stdscr.getkey() if key == "q": - exit(0) + sys.exit(0) elif key == "r": idx.setIdx(0) get_key(stdscr, stack, headers, idx) @@ -101,7 +103,7 @@ def get_key(stdscr, stack, headers, idx): while True: key = stdscr.getkey() if key == "q": - exit(0) + sys.exit(0) elif key in ["l", "KEY_LEFT"]: idx.forward(stack) idx.setSide(0)