#NEWLINE# def __init__( self , timeout , op_name = None , timeout_name = None ) : #NEWLINE# #INDENT# if op_name : #NEWLINE# #INDENT# op_name = ( _ ( "Operation with name '%s'" ) % op_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# op_name = _ ( 'Operation' ) #NEWLINE# #UNINDENT# formatted_message = ( self . message_template % { #NEWLINE# #INDENT# 'operation' : op_name , #NEWLINE# 'timeout' : op_name , #NEWLINE# #UNINDENT# } ) #NEWLINE# if timeout_name : #NEWLINE# #INDENT# desc = _ ( '%(message)s and following timeout was violated: %(timeout_name)s' ) #NEWLINE# formatted_message = ( desc % { #NEWLINE# #INDENT# 'message' : formatted_message , #NEWLINE# 'timeout_name' : timeout_name , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# super ( TimeoutException , self ) . __init__ ( formatted_message )