From 3fb3f589752589827e6dfef074e9153d10b0ed4b Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Sat, 2 May 2015 17:34:53 -0700 Subject: [PATCH] Minor bugfixes. --- rtv/curses_helpers.py | 11 +++++------ rtv/submission.py | 2 +- rtv/subreddit.py | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/rtv/curses_helpers.py b/rtv/curses_helpers.py index c465262..0ed8924 100644 --- a/rtv/curses_helpers.py +++ b/rtv/curses_helpers.py @@ -22,10 +22,10 @@ ESCAPE = 27 # found to be buggy and a PITA to work with. By defining them as unicode # points they can be added via the more reliable curses.addstr(). # http://bugs.python.org/issue21088 -UARROW = u'\u25b2'.encode('utf-8') -DARROW = u'\u25bc'.encode('utf-8') -BULLET = u'\u2022'.encode('utf-8') -GOLD = u'\u272A'.encode('utf-8') +UARROW = u'\u25b2' +DARROW = u'\u25bc' +BULLET = u'\u2022' +GOLD = u'\u272A' def get_arrow(likes): """ @@ -56,8 +56,6 @@ def add_line(window, text, row=None, col=None, attr=None): # (window, text, row, col) # (window, text, row, col, attr) - text = clean(text) - cursor_row, cursor_col = window.getyx() row = row if row is not None else cursor_row col = col if col is not None else cursor_col @@ -68,6 +66,7 @@ def add_line(window, text, row=None, col=None, attr=None): # Trying to draw outside of the screen bounds return + text = clean(text) text = textual_width_chop(text, n_cols) if attr is None: diff --git a/rtv/submission.py b/rtv/submission.py index af20308..98738a7 100644 --- a/rtv/submission.py +++ b/rtv/submission.py @@ -166,7 +166,7 @@ class SubmissionPage(BasePage): attr = curses.A_BOLD | Color.YELLOW add_line(win, u'{flair} '.format(**data), attr=attr) - text, attr = get_arrow(likes) + text, attr = get_arrow(data['likes']) add_line(win, text, attr=attr) add_line(win, u' {score} {created} '.format(**data)) diff --git a/rtv/subreddit.py b/rtv/subreddit.py index 0f23bea..86b106f 100644 --- a/rtv/subreddit.py +++ b/rtv/subreddit.py @@ -191,4 +191,4 @@ class SubredditPage(BasePage): if row in valid_rows: add_line(win, u'{author}'.format(**data), row, 1, curses.A_BOLD) add_line(win, u' {subreddit}'.format(**data), attr=Color.YELLOW) - add_line(Win, u' {flair}'.format(**data), attr=Color.RED) \ No newline at end of file + add_line(win, u' {flair}'.format(**data), attr=Color.RED) \ No newline at end of file