From 7b95ee240e8cb7b0ed34e16840db6435a69dfb92 Mon Sep 17 00:00:00 2001 From: 5225225 <5225225@users.noreply.github.com> Date: Sat, 9 Jan 2016 08:56:58 +0000 Subject: [PATCH] Add stickied tag for stickied posts. --- rtv/content.py | 1 + rtv/subreddit.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/rtv/content.py b/rtv/content.py index aecbf62..6ee6d44 100644 --- a/rtv/content.py +++ b/rtv/content.py @@ -153,6 +153,7 @@ class Content(object): data['likes'] = sub.likes data['gold'] = sub.gilded > 0 data['nsfw'] = sub.over_18 + data['stickied'] = sub.stickied data['index'] = None # This is filled in later by the method caller if sub.url.split('/r/')[-1] == sub.permalink.split('/r/')[-1]: diff --git a/rtv/subreddit.py b/rtv/subreddit.py index 63432f0..2d79133 100644 --- a/rtv/subreddit.py +++ b/rtv/subreddit.py @@ -191,6 +191,9 @@ class SubredditPage(Page): text, attr = self.term.get_arrow(data['likes']) self.term.add_line(win, text, attr=attr) 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']: text, attr = self.term.guilded