from random import shuffle
import sys
import textwrap
+import time
from . import runner, progress
self.get_key()
+ def check_size(self):
+ (mlines, mcols) = self.win.getmaxyx()
+
+ while mlines < 24 or mcols < 60:
+ self.main_win.clear()
+ self.main_win.addstr(
+ 0,
+ 0,
+ textwrap.fill(
+ "Terminal too small! Min size 60x24", width=mcols
+ ),
+ )
+ self.main_win.redrawwin()
+ self.main_win.refresh()
+ (mlines, mcols) = self.win.getmaxyx()
+ time.sleep(0.1)
+ else:
+ self.disp_card()
+
def update_panels(self):
"""Update panel and window contents"""
curses.panel.update_panels()
Display a card and wait for the input.
Used as a general way of getting back into the card flow from a menu
"""
- self.disp_card()
while True:
+ self.check_size()
key = self.win.getkey()
if key == "q":
self.leave()
(mlines, mcols) = self.win.getmaxyx()
left = mcols - 19
+ for i in range(20):
+ self.win.addch(0, mcols - 20 + i, " ")
+
self.win.addstr(
0,
mcols - 16,