#NEWLINE# def _getEndpointConnection( self , epA , epB ) : #NEWLINE# #INDENT# ' Internally used method to get the connection between two endpoints.\n\n            @param epX:         The endpoint which is part of the connection\n                                that should be retrieved.\n            @type  epX:         rce.core.network.Endpoint\n\n            @return:            Connection between the two endpoints.\n            @rtype:             rce.core.network.EndpointConnection\n        ' #NEWLINE# if ( ( epA not in self . _endpoints ) or ( epB not in self . _endpoints ) ) : #NEWLINE# #INDENT# raise InternalError ( 'Endpoint is not part of this network.' ) #NEWLINE# #UNINDENT# if ( epA == epB ) : #NEWLINE# #INDENT# return epA . getLoopback ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# connectionsA = self . _endpoints [ epA ] #NEWLINE# connectionsB = self . _endpoints [ epB ] #NEWLINE# candidates = connectionsA . intersection ( connectionsB ) #NEWLINE# if candidates : #NEWLINE# #INDENT# if ( len ( candidates ) != 1 ) : #NEWLINE# #INDENT# raise InternalError ( 'There are more than one possible endpoint connections.' ) #NEWLINE# #UNINDENT# return candidates . pop ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# connection = EndpointConnection ( epA , epB ) #NEWLINE# connectionsA . add ( connection ) #NEWLINE# connectionsB . add ( connection ) #NEWLINE# return connection