#NEWLINE# def __init__( self , code , message = None ) : #NEWLINE# #INDENT# if ( isinstance ( code , int ) and ( code > 0 ) and ( code in constants . command_status_value_map ) ) : #NEWLINE# #INDENT# self . status = getattr ( pdu_types . CommandStatus , constants . command_status_value_map [ code ] [ 'name' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . status = pdu_types . CommandStatus . ESME_RSYSERR #NEWLINE# #UNINDENT# if ( message is None ) : #NEWLINE# #INDENT# SMPPProtocolError . __init__ ( self , ( '%s' % self . getStatusDescription ( ) ) , self . status ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# SMPPProtocolError . __init__ ( self , message , code . status )