added gold symbol next to gilded comments
This commit is contained in:
@@ -79,6 +79,7 @@ class BaseContent(object):
|
|||||||
flair = comment.author_flair_text
|
flair = comment.author_flair_text
|
||||||
data['flair'] = (flair if flair else '')
|
data['flair'] = (flair if flair else '')
|
||||||
data['likes'] = comment.likes
|
data['likes'] = comment.likes
|
||||||
|
data['gold'] = comment.gilded > 0
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ ESCAPE = 27
|
|||||||
UARROW = u'\u25b2'.encode('utf-8')
|
UARROW = u'\u25b2'.encode('utf-8')
|
||||||
DARROW = u'\u25bc'.encode('utf-8')
|
DARROW = u'\u25bc'.encode('utf-8')
|
||||||
BULLET = u'\u2022'.encode('utf-8')
|
BULLET = u'\u2022'.encode('utf-8')
|
||||||
|
GOLD = u'\u272A'.encode('utf-8')
|
||||||
|
|
||||||
|
|
||||||
def show_notification(stdscr, message):
|
def show_notification(stdscr, message):
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import praw.errors
|
|||||||
from .content import SubmissionContent
|
from .content import SubmissionContent
|
||||||
from .page import BasePage, Navigator, BaseController
|
from .page import BasePage, Navigator, BaseController
|
||||||
from .helpers import clean, open_browser, open_editor
|
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)
|
show_notification, text_input)
|
||||||
from .docs import COMMENT_FILE
|
from .docs import COMMENT_FILE
|
||||||
|
|
||||||
@@ -160,6 +160,10 @@ class SubmissionPage(BasePage):
|
|||||||
text = clean(u' {score} {created} '.format(**data))
|
text = clean(u' {score} {created} '.format(**data))
|
||||||
win.addnstr(text, n_cols - win.getyx()[1])
|
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'])
|
n_body = len(data['split_body'])
|
||||||
for row, text in enumerate(data['split_body'], start=offset + 1):
|
for row, text in enumerate(data['split_body'], start=offset + 1):
|
||||||
if row in valid_rows:
|
if row in valid_rows:
|
||||||
|
|||||||
Reference in New Issue
Block a user