<s> from atom . api import Unicode , List , Dict <EOL> from enaml . core . declarative import d_ <EOL> from html_object import HTMLObject <EOL> from lxml . html import builder as E <EOL> class Dropdown ( HTMLObject ) : <EOL> tag = E . SELECT <EOL> text = d_ ( Unicode ( ) ) <EOL> id = d_ ( Unicode ( ) ) <EOL> options = d_ ( Dict ( ) ) <EOL> def initialize ( self ) : <EOL> super ( Dropdown , self ) . initialize ( ) <EOL> def buildHTML ( self , * args ) : <EOL> for key , value in self . options . iteritems ( ) : <EOL> self . addTags ( E . OPTION ( value , value = key ) ) <EOL> self . addText ( self . text ) <EOL> if self . id : <EOL> self . addAttributes ( id = self . id ) <EOL> return super ( Dropdown , self ) . buildHTML ( * args ) </s>
