added gold symbol next to gilded comments

This commit is contained in:
Tobin
2015-04-03 00:43:28 -05:00
parent 09c4865ece
commit dcdfd643cc
3 changed files with 8 additions and 2 deletions

View File

@@ -79,6 +79,7 @@ class BaseContent(object):
flair = comment.author_flair_text
data['flair'] = (flair if flair else '')
data['likes'] = comment.likes
data['gold'] = comment.gilded > 0
return data

View File

@@ -22,6 +22,7 @@ ESCAPE = 27
UARROW = u'\u25b2'.encode('utf-8')
DARROW = u'\u25bc'.encode('utf-8')
BULLET = u'\u2022'.encode('utf-8')
GOLD = u'\u272A'.encode('utf-8')
def show_notification(stdscr, message):

View File

@@ -7,7 +7,7 @@ import praw.errors
from .content import SubmissionContent
from .page import BasePage, Navigator, BaseController
from .helpers import clean, open_browser, open_editor
from .curses_helpers import (BULLET, UARROW, DARROW, Color, LoadScreen,
from .curses_helpers import (BULLET, UARROW, DARROW, GOLD, Color, LoadScreen,
show_notification, text_input)
from .docs import COMMENT_FILE
@@ -157,9 +157,13 @@ class SubmissionPage(BasePage):
text, attr = DARROW, (curses.A_BOLD | Color.RED)
win.addnstr(text, n_cols - win.getyx()[1], attr)
text = clean(u' {score} {created}'.format(**data))
text = clean(u' {score} {created} '.format(**data))
win.addnstr(text, n_cols - win.getyx()[1])
if data['gold']:
text, attr = GOLD, (curses.A_BOLD | Color.YELLOW)
win.addnstr(text, n_cols - win.getyx()[1], attr)
n_body = len(data['split_body'])
for row, text in enumerate(data['split_body'], start=offset + 1):
if row in valid_rows: