#NEWLINE# def _apply_action( self , case_update , action , xform ) : #NEWLINE# #INDENT# if ( action . action_type_slug == const . CASE_ACTION_CREATE ) : #NEWLINE# #INDENT# self . _apply_create_action ( case_update , action ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( action . action_type_slug == const . CASE_ACTION_UPDATE ) : #NEWLINE# #INDENT# self . _apply_update_action ( action ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( action . action_type_slug == const . CASE_ACTION_INDEX ) : #NEWLINE# #INDENT# self . _apply_index_action ( action ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . action_type_slug == const . CASE_ACTION_CLOSE ) : #NEWLINE# #INDENT# self . _apply_close_action ( case_update ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( action . action_type_slug == const . CASE_ACTION_ATTACHMENT ) : #NEWLINE# #INDENT# self . _apply_attachments_action ( action , xform ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( "Can't apply action of type %s: %s" % ( action . action_type , self . case . case_id ) ) )