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 from i3pystatus.core.util import TimeWrapper
import subprocess import subprocess
class Cmus(IntervalModule): class Cmus(IntervalModule):
""" """
@ -23,7 +24,8 @@ 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,
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
@ -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),