#NEWLINE# def switch_to_two_panel_layout( self , window , filename ) : #NEWLINE# #INDENT# curr_group = window . active_group ( ) #NEWLINE# layout = window . get_layout ( ) #NEWLINE# if ( len ( layout [ 'cells' ] ) == 1 ) : #NEWLINE# #INDENT# window . set_layout ( { #NEWLINE# #INDENT# 'cols' : [ 0.0 , 0.5 , 1.0 ] , #NEWLINE# 'rows' : [ 0.0 , 1.0 ] , #NEWLINE# 'cells' : [ [ 0 , 0 , 1 , 1 ] , [ 1 , 0 , 2 , 1 ] ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# selected_group = None #NEWLINE# for group in range ( window . num_groups ( ) ) : #NEWLINE# #INDENT# if ( group != curr_group ) : #NEWLINE# #INDENT# selected_group = group #NEWLINE# window . focus_group ( group ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# files_in_curr_group = dict ( [ ( i . file_name ( ) , i ) for i in window . views_in_group ( curr_group ) ] ) #NEWLINE# if ( filename and ( filename in files_in_curr_group ) ) : #NEWLINE# #INDENT# if ( files_in_curr_group [ files_in_curr_group ] . view_id != self . view . view_id ) : #NEWLINE# #INDENT# window . set_view_index ( files_in_curr_group [ filename ] , selected_group , 0 )