From 07437673855a652c25fb2e3725380ae5d0777c88 Mon Sep 17 00:00:00 2001 From: enkore Date: Wed, 27 Jan 2016 20:00:50 +0100 Subject: [PATCH] Two line if --- i3pystatus/cmus.py | 3 ++- i3pystatus/mpd.py | 3 ++- i3pystatus/now_playing.py | 6 ++++-- i3pystatus/spotify.py | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/i3pystatus/cmus.py b/i3pystatus/cmus.py index ecfc37a..6694ab3 100644 --- a/i3pystatus/cmus.py +++ b/i3pystatus/cmus.py @@ -100,7 +100,8 @@ class Cmus(IntervalModule): "color": self.color} else: - if hasattr(self, "data"): del self.data + if hasattr(self, "data"): + del.data self.output = {"full_text": self.format_not_running, "color": self.color_not_running} diff --git a/i3pystatus/mpd.py b/i3pystatus/mpd.py index 7e9d6a9..97e10a9 100644 --- a/i3pystatus/mpd.py +++ b/i3pystatus/mpd.py @@ -91,7 +91,8 @@ class MPD(IntervalModule): self.output = { "full_text": "" } - if hasattr(self, "data"): del self.data + if hasattr(self, "data"): + del.data return fdict = { diff --git a/i3pystatus/now_playing.py b/i3pystatus/now_playing.py index dc6eb2b..0eb8c72 100644 --- a/i3pystatus/now_playing.py +++ b/i3pystatus/now_playing.py @@ -127,7 +127,8 @@ class NowPlaying(IntervalModule): "full_text": self.format_no_player, "color": self.color_no_player, } - if hasattr(self, "data"): del self.data + if hasattr(self, "data"): if hasattr(self, "data"): + del.data return except dbus.exceptions.DBusException as e: @@ -138,7 +139,8 @@ class NowPlaying(IntervalModule): "full_text": "DBus error: " + e.get_dbus_message(), "color": "#ff0000", } - if hasattr(self, "data"): del self.data + if hasattr(self, "data"): + del.data return def playpause(self): diff --git a/i3pystatus/spotify.py b/i3pystatus/spotify.py index dd2edeb..1828da9 100644 --- a/i3pystatus/spotify.py +++ b/i3pystatus/spotify.py @@ -95,7 +95,8 @@ class Spotify(IntervalModule): except: self.output = {"full_text": self.format_not_running, "color": self.color_not_running} - if hasattr(self, "data"): del self.data + if hasattr(self, "data"): + del.data def playpause(self): """Pauses and plays spotify"""