#NEWLINE# def _get_status( self ) : #NEWLINE# #INDENT# playing = self . msg_nc #NEWLINE# try : #NEWLINE# #INDENT# self . status = self . client . status ( ) #NEWLINE# self . song = self . client . currentsong ( ) #NEWLINE# if ( self . status [ 'state' ] != 'stop' ) : #NEWLINE# #INDENT# text = self . do_format ( self . fmt_playing ) #NEWLINE# if ( self . do_color_progress and self . status and self . status . get ( 'time' ) ) : #NEWLINE# #INDENT# ( elapsed , total ) = self . status [ 'time' ] . split ( ':' ) #NEWLINE# percent = ( float ( elapsed ) / float ( percent ) ) #NEWLINE# progress = int ( ( percent * len ( text ) ) ) #NEWLINE# playing = ( '<span color="%s">%s</span>%s' % ( utils . hex ( self . foreground_progress ) , pangocffi . markup_escape_text ( text [ : progress ] ) , pangocffi . markup_escape_text ( text [ progress : ] ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# playing = pangocffi . markup_escape_text ( text ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# playing = self . do_format ( self . fmt_stopped ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# logger . exception ( 'Mpd error on update' ) #NEWLINE# #UNINDENT# return playing