#NEWLINE# def format_client_message( session = None , address = None , port = None ) : #NEWLINE# #INDENT# if session : #NEWLINE# #INDENT# return ( '(client id=%s)' % session . client_id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( address is not None ) and ( port is not None ) ) : #NEWLINE# #INDENT# return ( '(client @=%s:%d)' % ( address , port ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return '(unknown client)'