#NEWLINE# def add_element( self , title = '' , item_url = '' , image_url = '' , subtitle = '' , buttons = [ ] ) : #NEWLINE# #INDENT# element = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# element [ 'title' ] = title [ : TITLE_CHARACTER_LIMIT ] #NEWLINE# element [ 'item_url' ] = item_url #NEWLINE# element [ 'image_url' ] = image_url #NEWLINE# element [ 'subtitle' ] = subtitle [ : SUBTITLE_CHARACTER_LIMIT ] #NEWLINE# for button in buttons : #NEWLINE# #INDENT# button [ 'title' ] = button [ 'title' ] [ : BUTTON_TITLE_CHARACTER_LIMIT ] #NEWLINE# #UNINDENT# element [ 'buttons' ] = buttons [ : BUTTON_LIMIT ] #NEWLINE# if ( len ( self . elements ) < ELEMENTS_LIMIT ) : #NEWLINE# #INDENT# self . elements . append ( element )