#NEWLINE# def onSwapRoleAck( self ) : #NEWLINE# #INDENT# '\n        Callback method to respond to accepted role swap response from the connected peer.\n        The caller of swapRole() waits for this method before actually swapping roles on its side.\n        ' #NEWLINE# if ( self . role == base . HOST_ROLE ) : #NEWLINE# #INDENT# self . role = base . PARTNER_ROLE #NEWLINE# self . view . set_read_only ( True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . role = base . HOST_ROLE #NEWLINE# self . view . set_read_only ( False ) #NEWLINE# self . viewMonitorThread = ViewMonitorThread ( self ) #NEWLINE# self . viewMonitorThread . start ( ) #NEWLINE# #UNINDENT# view_name = self . view . file_name ( ) #NEWLINE# if ( ( not self ) or ( len ( view_name ) == 0 ) ) : #NEWLINE# #INDENT# view_name = self . view . name ( ) #NEWLINE# if ( ( not view_name ) or ( len ( view_name ) == 0 ) ) : #NEWLINE# #INDENT# view_name = 'untitled' #NEWLINE# #UNINDENT# #UNINDENT# self . logger . info ( ( 'session %s with %s role now changed to %s' % ( view_name , self . str ( ) , self . role ) ) )