Minor bugfixes.
This commit is contained in:
@@ -22,10 +22,10 @@ ESCAPE = 27
|
|||||||
# found to be buggy and a PITA to work with. By defining them as unicode
|
# 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().
|
# points they can be added via the more reliable curses.addstr().
|
||||||
# http://bugs.python.org/issue21088
|
# http://bugs.python.org/issue21088
|
||||||
UARROW = u'\u25b2'.encode('utf-8')
|
UARROW = u'\u25b2'
|
||||||
DARROW = u'\u25bc'.encode('utf-8')
|
DARROW = u'\u25bc'
|
||||||
BULLET = u'\u2022'.encode('utf-8')
|
BULLET = u'\u2022'
|
||||||
GOLD = u'\u272A'.encode('utf-8')
|
GOLD = u'\u272A'
|
||||||
|
|
||||||
def get_arrow(likes):
|
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)
|
||||||
# (window, text, row, col, attr)
|
# (window, text, row, col, attr)
|
||||||
|
|
||||||
text = clean(text)
|
|
||||||
|
|
||||||
cursor_row, cursor_col = window.getyx()
|
cursor_row, cursor_col = window.getyx()
|
||||||
row = row if row is not None else cursor_row
|
row = row if row is not None else cursor_row
|
||||||
col = col if col is not None else cursor_col
|
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
|
# Trying to draw outside of the screen bounds
|
||||||
return
|
return
|
||||||
|
|
||||||
|
text = clean(text)
|
||||||
text = textual_width_chop(text, n_cols)
|
text = textual_width_chop(text, n_cols)
|
||||||
|
|
||||||
if attr is None:
|
if attr is None:
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class SubmissionPage(BasePage):
|
|||||||
attr = curses.A_BOLD | Color.YELLOW
|
attr = curses.A_BOLD | Color.YELLOW
|
||||||
add_line(win, u'{flair} '.format(**data), attr=attr)
|
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, text, attr=attr)
|
||||||
add_line(win, u' {score} {created} '.format(**data))
|
add_line(win, u' {score} {created} '.format(**data))
|
||||||
|
|
||||||
|
|||||||
@@ -191,4 +191,4 @@ class SubredditPage(BasePage):
|
|||||||
if row in valid_rows:
|
if row in valid_rows:
|
||||||
add_line(win, u'{author}'.format(**data), row, 1, curses.A_BOLD)
|
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' {subreddit}'.format(**data), attr=Color.YELLOW)
|
||||||
add_line(Win, u' {flair}'.format(**data), attr=Color.RED)
|
add_line(win, u' {flair}'.format(**data), attr=Color.RED)
|
||||||
Reference in New Issue
Block a user