Making code changes requested by @ZyX-I a day ago

This commit is contained in:
Jesús Rafael Sánchez 2017-07-31 07:26:56 -04:00
parent b82769ad4b
commit 0595c89f21

View File

@ -534,7 +534,8 @@ class MocPlayerSegment(PlayerSegment):
def get_player_status(self, pl): def get_player_status(self, pl):
'''Return Music On Console (mocp) player information. '''Return Music On Console (mocp) player information.
mocp -i returns current information i.e. `mocp -i` returns current information i.e.
.. code-block::
File: filename.format File: filename.format
Title: full title Title: full title
Artist: artist name Artist: artist name
@ -562,11 +563,11 @@ class MocPlayerSegment(PlayerSegment):
'File', 'TimeLeft', 'Title', 'File', 'TimeLeft', 'Title',
'Bitrate', 'AvgBitrate', 'Rate' 'Bitrate', 'AvgBitrate', 'Rate'
) )
now_playing = dict( now_playing = dict((
[line.split(': ') line.split(': ')
for line in now_playing_str.split('\n')[:-1] for line in now_playing_str.split('\n')[:-1]
if line.split(': ')[0] not in ignore_info] if line.split(': ')[0] not in ignore_info
) ))
state = _convert_state(now_playing.get('State')) state = _convert_state(now_playing.get('State'))
return { return {
'state': state, 'state': state,
@ -581,7 +582,7 @@ class MocPlayerSegment(PlayerSegment):
mocp = with_docstring(MocPlayerSegment(), mocp = with_docstring(MocPlayerSegment(),
('''Return MOC (Music On Console) player information ('''Return MOC (Music On Console) player information
Requires mocp command be acessible from $PATH. Requires version >= 2.3.0 and `mocp` command be acessible from $PATH.
{0} {0}
''').format(_common_args.format('mocp'))) ''').format(_common_args.format('mocp')))