Pep8 formatting

This commit is contained in:
Sergei Turukin 2014-10-23 14:35:06 +03:00
parent 2ae45ec1e7
commit 1ca35c238e

View File

@ -4,6 +4,7 @@ from i3pystatus import IntervalModule, formatp
from i3pystatus.core.util import TimeWrapper
import subprocess
class Cmus(IntervalModule):
"""
@ -23,6 +24,7 @@ class Cmus(IntervalModule):
"playing": "",
"stopped": "",
}
def _cmus_command(self, command):
p = subprocess.Popen('cmus-remote --{command}'.format(command=command), shell=True,
stdout=subprocess.PIPE,
@ -60,12 +62,14 @@ class Cmus(IntervalModule):
}
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']:
_, filename = os.path.split(fdict['file'])
filebase, _ = os.path.splitext(filename)
fdict['artist'], fdict['title'] = (filebase.split('-') + [''] * 2)[:2]
fdict['artist'], fdict['title'] = (
filebase.split('-') + [''] * 2)[:2]
self.output = {
"full_text": formatp(self.format, **fdict),