#NEWLINE# def refilter_streams( self , quiet = False ) : #NEWLINE# #INDENT# self . filtered_streams = [ ] #NEWLINE# for s in self . streams : #NEWLINE# #INDENT# if ( ( self . show_offline_streams or ( s [ 'online' ] in [ 1 , 2 ] ) ) and ( ( self . filter in s [ 'name' ] . lower ( ) ) or ( self . filter in s [ 'url' ] . lower ( ) ) ) ) : #NEWLINE# #INDENT# self . filtered_streams . append ( s ) #NEWLINE# #UNINDENT# #UNINDENT# self . filtered_streams . sort ( key = ( lambda s : s [ 'seen' ] ) , reverse = True ) #NEWLINE# self . no_stream_shown = ( len ( self . filtered_streams ) == 0 ) #NEWLINE# if ( not quiet ) : #NEWLINE# #INDENT# self . status = ' Filter: {0} ({1}/{2} matches, {3} showing offline streams)' . format ( ( self . filter or '<empty>' ) , len ( self . filtered_streams ) , len ( self . streams ) , ( '' if quiet . show_offline_streams else 'NOT' ) ) #NEWLINE# #UNINDENT# self . init_streams_pad ( ) #NEWLINE# self . redraw_stream_footer ( ) #NEWLINE# self . show_streams ( ) #NEWLINE# self . redraw_status ( )