#NEWLINE# def insertListItem( select , item , value , index ) : #NEWLINE# #INDENT# option = createElement ( 'OPTION' ) #NEWLINE# setInnerText ( option , item ) #NEWLINE# if ( value is not None ) : #NEWLINE# #INDENT# setAttribute ( option , 'value' , value ) #NEWLINE# #UNINDENT# if ( index == ( - 1 ) ) : #NEWLINE# #INDENT# appendChild ( select , option ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# insertChild ( select , option , index )