'Enables dictionary-style access by UI name. Lookup by style id is
deprecated, triggers a warning, and will be removed in a near-future
release.'

def __getitem__(self, key):

    style_elm = self._element.get_by_name(BabelFish.ui2internal(key))
    if (style_elm is not None):
        return StyleFactory(style_elm)
    style_elm = self._element.get_by_id(key)
    if (style_elm is not None):
        msg = u'style    lookup    by    style_id    is    deprecated.    Use    style    name    as    key    instead.'
        warn(msg, UserWarning)
        return StyleFactory(style_elm)
    raise KeyError((u"no    style    with    name    '%s'" % key))
