Pep8 formatting
This commit is contained in:
parent
2ae45ec1e7
commit
1ca35c238e
@ -4,6 +4,7 @@ from i3pystatus import IntervalModule, formatp
|
|||||||
from i3pystatus.core.util import TimeWrapper
|
from i3pystatus.core.util import TimeWrapper
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
class Cmus(IntervalModule):
|
class Cmus(IntervalModule):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -23,6 +24,7 @@ class Cmus(IntervalModule):
|
|||||||
"playing": "▶",
|
"playing": "▶",
|
||||||
"stopped": "◾",
|
"stopped": "◾",
|
||||||
}
|
}
|
||||||
|
|
||||||
def _cmus_command(self, command):
|
def _cmus_command(self, command):
|
||||||
p = subprocess.Popen('cmus-remote --{command}'.format(command=command), shell=True,
|
p = subprocess.Popen('cmus-remote --{command}'.format(command=command), shell=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
@ -60,12 +62,14 @@ class Cmus(IntervalModule):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if fdict['stream']:
|
if fdict['stream']:
|
||||||
fdict['artist'], fdict['title'] = (fdict['stream'].split('-') + [''] * 2)[:2]
|
fdict['artist'], fdict['title'] = (
|
||||||
|
fdict['stream'].split('-') + [''] * 2)[:2]
|
||||||
|
|
||||||
elif not fdict['title']:
|
elif not fdict['title']:
|
||||||
_, filename = os.path.split(fdict['file'])
|
_, filename = os.path.split(fdict['file'])
|
||||||
filebase, _ = os.path.splitext(filename)
|
filebase, _ = os.path.splitext(filename)
|
||||||
fdict['artist'], fdict['title'] = (filebase.split('-') + [''] * 2)[:2]
|
fdict['artist'], fdict['title'] = (
|
||||||
|
filebase.split('-') + [''] * 2)[:2]
|
||||||
|
|
||||||
self.output = {
|
self.output = {
|
||||||
"full_text": formatp(self.format, **fdict),
|
"full_text": formatp(self.format, **fdict),
|
||||||
|
Loading…
Reference in New Issue
Block a user