#NEWLINE# def __str__( self ) : #NEWLINE# #INDENT# ( ipaddr , port ) = port . sockaddr #NEWLINE# if ( ':' in ipaddr ) : #NEWLINE# #INDENT# return 'Connected to [{0}]:{1}' . format ( ipaddr , port ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return 'Connected to {0}:{1}' . format ( ipaddr , port )