Add stickied tag for stickied posts.
This commit is contained in:
@@ -153,6 +153,7 @@ class Content(object):
|
|||||||
data['likes'] = sub.likes
|
data['likes'] = sub.likes
|
||||||
data['gold'] = sub.gilded > 0
|
data['gold'] = sub.gilded > 0
|
||||||
data['nsfw'] = sub.over_18
|
data['nsfw'] = sub.over_18
|
||||||
|
data['stickied'] = sub.stickied
|
||||||
data['index'] = None # This is filled in later by the method caller
|
data['index'] = None # This is filled in later by the method caller
|
||||||
|
|
||||||
if sub.url.split('/r/')[-1] == sub.permalink.split('/r/')[-1]:
|
if sub.url.split('/r/')[-1] == sub.permalink.split('/r/')[-1]:
|
||||||
|
|||||||
@@ -191,6 +191,9 @@ class SubredditPage(Page):
|
|||||||
text, attr = self.term.get_arrow(data['likes'])
|
text, attr = self.term.get_arrow(data['likes'])
|
||||||
self.term.add_line(win, text, attr=attr)
|
self.term.add_line(win, text, attr=attr)
|
||||||
self.term.add_line(win, ' {created} {comments} '.format(**data))
|
self.term.add_line(win, ' {created} {comments} '.format(**data))
|
||||||
|
if data['stickied']:
|
||||||
|
text, attr = self.term.stickied
|
||||||
|
self.term.add_line(win, text, attr=attr)
|
||||||
|
|
||||||
if data['gold']:
|
if data['gold']:
|
||||||
text, attr = self.term.guilded
|
text, attr = self.term.guilded
|
||||||
|
|||||||
Reference in New Issue
Block a user