<s> from __future__ import ( unicode_literals , division , absolute_import , print_function ) <EOL> from powerline . theme import requires_segment_info <EOL> from powerline . lib . dict import updated <EOL> from powerline . bindings . wm import get_i3_connection , get_connected_xrandr_outputs <EOL> @ requires_segment_info <EOL> def output_lister ( pl , segment_info ) : <EOL> '''<STR_LIT>''' <EOL> return ( <EOL> ( <EOL> updated ( segment_info , output = output [ '<STR_LIT:name>' ] ) , <EOL> { <EOL> '<STR_LIT>' : None <EOL> } <EOL> ) <EOL> for output in get_connected_xrandr_outputs ( pl ) <EOL> ) <EOL> @ requires_segment_info <EOL> def workspace_lister ( pl , segment_info , only_show = None , output = None ) : <EOL> '''<STR_LIT>''' <EOL> if output == None : <EOL> output = output or segment_info . get ( '<STR_LIT>' ) <EOL> return ( <EOL> ( <EOL> updated ( <EOL> segment_info , <EOL> output = w [ '<STR_LIT>' ] , <EOL> workspace = { <EOL> '<STR_LIT:name>' : w [ '<STR_LIT:name>' ] , <EOL> '<STR_LIT>' : w [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : w [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : w [ '<STR_LIT>' ] , <EOL> } , <EOL> ) , <EOL> { <EOL> '<STR_LIT>' : None <EOL> } <EOL> ) <EOL> for w in get_i3_connection ( ) . get_workspaces ( ) <EOL> if ( ( ( not only_show or any ( w [ typ ] for typ in only_show ) ) <EOL> and ( not output or w [ '<STR_LIT>' ] == output ) ) ) <EOL> ) </s>
