Merge pull request #251 from kunalshetye/issue-250
Added a hidden method to hide mpd widget when no music is playing
This commit is contained in:
commit
fa9ad10549
1 changed files with 4 additions and 0 deletions
|
@ -55,6 +55,9 @@ class Module(bumblebee.engine.Module):
|
||||||
self._repeat = False
|
self._repeat = False
|
||||||
self._tags = defaultdict(lambda: '')
|
self._tags = defaultdict(lambda: '')
|
||||||
|
|
||||||
|
def hidden(self):
|
||||||
|
return self._status == None
|
||||||
|
|
||||||
@scrollable
|
@scrollable
|
||||||
def description(self, widget):
|
def description(self, widget):
|
||||||
return string.Formatter().vformat(self._fmt, (), self._tags)
|
return string.Formatter().vformat(self._fmt, (), self._tags)
|
||||||
|
@ -80,6 +83,7 @@ class Module(bumblebee.engine.Module):
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
pass
|
pass
|
||||||
self._tags = defaultdict(lambda: '')
|
self._tags = defaultdict(lambda: '')
|
||||||
|
self._status = None
|
||||||
for line in info.split("\n"):
|
for line in info.split("\n"):
|
||||||
if line.startswith("[playing]"):
|
if line.startswith("[playing]"):
|
||||||
self._status = "playing"
|
self._status = "playing"
|
||||||
|
|
Loading…
Reference in a new issue