self.obj.setIdx(0)
self.get_key()
- def disp_menu(self, keygrab=True):
+ def disp_menu(self, keygrab=True, quit=False):
"""
Display a menu once the end of the deck has been reached, offering
multiple options on how to continue.
"""
+ quit_text = "[q]: back"
+ if quit:
+ quit_text = "[q]: quit"
+
self.win.addstr("LIGHTCARDS MENU", curses.color_pair(1) +
curses.A_BOLD)
self.win.hline(1, 0, curses.ACS_HLINE, 15)
"[d]: star all\n" +
"[s]: update stack to include starred only\n\n" +
"[r]: restart\n" +
- "[q]: back")
+ quit_text)
if keygrab:
self.menu_grab()
self.win.clear()
(mlines, mcols) = self.win.getmaxyx()
if self.obj.getIdx() == len(self.stack):
- self.disp_menu()
+ self.disp_menu(quit=True)
else:
# If on the back of the card, show the content of the front side in
# the header