diff --git a/rtv/submission.py b/rtv/submission.py index 7987340..6c5d154 100644 --- a/rtv/submission.py +++ b/rtv/submission.py @@ -142,8 +142,10 @@ class SubmissionPage(BasePage): n_rows, n_cols = win.getmaxyx() n_cols -= 3 # one for each side of the border + one for offset + # Don't print at all if there is not enough room to fit the whole sub if data['n_rows'] > n_rows: + win.addnstr(0, 0, '(Not enough space to display)', n_cols) return for row, text in enumerate(data['split_title'], start=1): @@ -166,7 +168,7 @@ class SubmissionPage(BasePage): win.addnstr(row, 1, text, n_cols) row = len(data['split_title']) + len(data['split_text']) + 3 - text = '{} {}'.format(data['score'], data['comments']) + text = '{score} {comments}'.format(**data) win.addnstr(row, 1, text, n_cols, curses.A_BOLD) win.border() \ No newline at end of file diff --git a/rtv/utils.py b/rtv/utils.py index cd3b247..4a9bb3e 100644 --- a/rtv/utils.py +++ b/rtv/utils.py @@ -41,6 +41,7 @@ class Color(object): curses.init_pair(index, code[0], code[1]) setattr(cls, attr, curses.color_pair(index)) + def text_input(window): """ Transform a window into a text box that will accept user input and loop