'This method is used when on any configurable object the developer does
something like:
def set_options( self, optionsList ):
self._check_persistent = optionsList[\'check_persistent\']
:return: The value of the item that was selected
>>> from w3af.core.data.options.opt_factory import opt_factory
>>> opt_list = OptionList()
>>> opt_list.add( opt_factory(\'name\', True, \'desc\', \'boolean\') )
>>> opt_list[\'name\']
<option name:name|type:boolean|value:True>'

def __getitem__(self, item_name):

    try:
        item_name = int(item_name)
    except:
        for o in self._internal_opt_list:
            if (o.get_name() == item_name):
                return o
        else:
            msg = 'The    OptionList    doesn\'t    contain    an    option    with    the    name:    "%s"'
            raise BaseFrameworkException((msg % item_name))
    else:
        return self._internal_opt_list[item_name]
