From d7826216961bab1c651d5597a9e8f88e38b9be07 Mon Sep 17 00:00:00 2001 From: enkore Date: Tue, 14 Oct 2014 16:43:02 +0200 Subject: [PATCH] PEP 8 (I'm bored): reddit --- i3pystatus/reddit.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/i3pystatus/reddit.py b/i3pystatus/reddit.py index 0e10439..f875de1 100644 --- a/i3pystatus/reddit.py +++ b/i3pystatus/reddit.py @@ -7,14 +7,13 @@ import praw class Reddit(IntervalModule): - """ This module fetches and displays posts and/or user mail/messages from reddit.com. Left-clicking on the display text opens the permalink/comments - page using webbrowser.open() while right-clicking opens the URL of the + page using webbrowser.open() while right-clicking opens the URL of the submission directly. Depends on the Python Reddit API Wrapper (PRAW) . - + .. rubric:: Available formatters * {submission_title} @@ -68,7 +67,7 @@ class Reddit(IntervalModule): @require(internet) def run(self): r = praw.Reddit(user_agent='i3pystatus') - + if self.password: r.login(self.username, self.password) unread_messages = sum(1 for i in r.get_unread()) @@ -113,7 +112,7 @@ class Reddit(IntervalModule): fdict["submission_url"] = d["url"] fdict["submission_domain"] = d["domain"] fdict["submission_subreddit"] = d["subreddit"] - + self._permalink = fdict["submission_permalink"] self._url = fdict["submission_url"] @@ -125,7 +124,7 @@ class Reddit(IntervalModule): color = self.color if len(fdict["submission_title"]) > self.title_maxlen: - title = fdict["submission_title"][:(self.title_maxlen-3)]+"..." + title = fdict["submission_title"][:(self.title_maxlen - 3)] + "..." fdict["submission_title"] = title full_text = self.format.format(**fdict) @@ -136,6 +135,6 @@ class Reddit(IntervalModule): def on_leftclick(self): user_open(self._permalink) - + def on_rightclick(self): user_open(self._url)