Two line if

This commit is contained in:
enkore 2016-01-27 20:00:50 +01:00
parent 612b8b07eb
commit 0743767385
4 changed files with 10 additions and 5 deletions

View File

@ -100,7 +100,8 @@ class Cmus(IntervalModule):
"color": self.color} "color": self.color}
else: else:
if hasattr(self, "data"): del self.data if hasattr(self, "data"):
del.data
self.output = {"full_text": self.format_not_running, self.output = {"full_text": self.format_not_running,
"color": self.color_not_running} "color": self.color_not_running}

View File

@ -91,7 +91,8 @@ class MPD(IntervalModule):
self.output = { self.output = {
"full_text": "" "full_text": ""
} }
if hasattr(self, "data"): del self.data if hasattr(self, "data"):
del.data
return return
fdict = { fdict = {

View File

@ -127,7 +127,8 @@ class NowPlaying(IntervalModule):
"full_text": self.format_no_player, "full_text": self.format_no_player,
"color": self.color_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 return
except dbus.exceptions.DBusException as e: except dbus.exceptions.DBusException as e:
@ -138,7 +139,8 @@ class NowPlaying(IntervalModule):
"full_text": "DBus error: " + e.get_dbus_message(), "full_text": "DBus error: " + e.get_dbus_message(),
"color": "#ff0000", "color": "#ff0000",
} }
if hasattr(self, "data"): del self.data if hasattr(self, "data"):
del.data
return return
def playpause(self): def playpause(self):

View File

@ -95,7 +95,8 @@ class Spotify(IntervalModule):
except: except:
self.output = {"full_text": self.format_not_running, self.output = {"full_text": self.format_not_running,
"color": self.color_not_running} "color": self.color_not_running}
if hasattr(self, "data"): del self.data if hasattr(self, "data"):
del.data
def playpause(self): def playpause(self):
"""Pauses and plays spotify""" """Pauses and plays spotify"""