Fixed suggested changes for pull request, changed colour of flairs to
yellow for more visibility on submission page
This commit is contained in:
@@ -141,10 +141,7 @@ class BaseContent(object):
|
||||
sub_author = (clean(comment.submission.author.name) if
|
||||
getattr(comment.submission, 'author') else '[deleted]')
|
||||
data['is_author'] = (data['author'] == sub_author)
|
||||
if comment.author_flair_text != None:
|
||||
data['flair'] = comment.author_flair_text
|
||||
else:
|
||||
data['flair'] = ""
|
||||
data['flair'] = (clean(comment.author_flair_text) if comment.author_flair_text else "")
|
||||
|
||||
return data
|
||||
|
||||
@@ -170,10 +167,7 @@ class BaseContent(object):
|
||||
else '[deleted]')
|
||||
data['permalink'] = clean(sub.permalink)
|
||||
data['subreddit'] = strip_subreddit_url(sub.permalink)
|
||||
if sub.link_flair_text != None:
|
||||
data['flair'] = sub.link_flair_text
|
||||
else:
|
||||
data['flair'] = ""
|
||||
data['flair'] = (clean(sub.link_flair_text) if sub.link_flair_text else "")
|
||||
data['url_full'] = clean(sub.url)
|
||||
data['url'] = ('selfpost' if is_selfpost(sub.url) else clean(sub.url))
|
||||
|
||||
|
||||
@@ -107,10 +107,12 @@ class SubmissionPage(BasePage):
|
||||
|
||||
row = offset
|
||||
if row in valid_rows:
|
||||
text = '{author} {flair}'.format(**data)
|
||||
text = '{author}'.format(**data)
|
||||
attr = curses.A_BOLD
|
||||
attr |= (Color.BLUE if not data['is_author'] else Color.GREEN)
|
||||
win.addnstr(row, 1, text, n_cols-1, attr)
|
||||
text = ' {flair}'.format(**data)
|
||||
win.addnstr(text, n_cols-win.getyx()[1], curses.A_BOLD | Color.YELLOW)
|
||||
text = ' {score} {created}'.format(**data)
|
||||
win.addnstr(text, n_cols - win.getyx()[1])
|
||||
|
||||
@@ -171,8 +173,8 @@ class SubmissionPage(BasePage):
|
||||
attr = curses.A_BOLD | Color.GREEN
|
||||
text = '{author}'.format(**data)
|
||||
win.addnstr(row, 1, text, n_cols, attr)
|
||||
text = '{flair}'.format(**data)
|
||||
win.addnstr(row, 1, text, n_cols, curses.A_BOLD | Color.GREEN)
|
||||
text = ' {flair}'.format(**data)
|
||||
win.addnstr(text, n_cols-win.getyx()[1], curses.A_BOLD | Color.YELLOW)
|
||||
text = ' {created} {subreddit}'.format(**data)
|
||||
win.addnstr(text, n_cols - win.getyx()[1])
|
||||
|
||||
|
||||
@@ -135,8 +135,7 @@ class SubredditPage(BasePage):
|
||||
if row in valid_rows:
|
||||
text = '{author}'.format(**data)
|
||||
win.addnstr(row, 1, text, n_cols-1, curses.A_BOLD)
|
||||
if data['flair'] != None:
|
||||
text = ' {flair}'.format(**data)
|
||||
win.addnstr(text, n_cols - 1, curses.A_BOLD | Color.GREEN)
|
||||
text = ' {flair}'.format(**data)
|
||||
win.addnstr(text, n_cols - 1, curses.A_BOLD | Color.GREEN)
|
||||
text = ' {subreddit}'.format(**data)
|
||||
win.addnstr(text, n_cols - win.getyx()[1], Color.YELLOW)
|
||||
|
||||
Reference in New Issue
Block a user