#NEWLINE# def parse( self ) : #NEWLINE# #INDENT# self . parsed = True #NEWLINE# ( protocol , reason_params ) = self . body . split ( ';' , 1 ) #NEWLINE# self . protocol = protocol . strip ( ) #NEWLINE# for reason_param in reason_params . split ( ';' ) : #NEWLINE# #INDENT# ( rp_name , rp_value ) = [ x . strip ( ) for x in reason_param . split ( '=' , 1 ) ] #NEWLINE# if ( rp_name == 'cause' ) : #NEWLINE# #INDENT# self . cause = int ( rp_value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( rp_name == 'text' ) : #NEWLINE# #INDENT# self . reason = rp_value . strip ( '"' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# assert ( self . cause != None )