#NEWLINE# def __init__( self , w , attr_map , focus_map = None ) : #NEWLINE# #INDENT# '\n        :param w: widget to wrap (stored as self.original_widget)\n        :type w: widget\n\n        :param attr_map: attribute to apply to *w*, or dict of old display\n            attribute: new display attribute mappings\n        :type attr_map: display attribute or dict\n\n        :param focus_map: attribute to apply when in focus or dict of\n            old display attribute: new display attribute mappings;\n            if ``None`` use *attr*\n        :type focus_map: display attribute or dict\n\n        >>> AttrMap(Divider(u"!"), \'bright\')\n        <AttrMap flow widget <Divider flow widget \'!\'> attr_map={None: \'bright\'}>\n        >>> AttrMap(Edit(), \'notfocus\', \'focus\')\n        <AttrMap selectable flow widget <Edit selectable flow widget \'\' edit_pos=0> attr_map={None: \'notfocus\'} focus_map={None: \'focus\'}>\n        >>> size = (5,)\n        >>> am = AttrMap(Text(u"hi"), \'greeting\', \'fgreet\')\n        >>> am.render(size, focus=False).content().next() # ... = b in Python 3\n        [(\'greeting\', None, ...\'hi   \')]\n        >>> am.render(size, focus=True).content().next()\n        [(\'fgreet\', None, ...\'hi   \')]\n        >>> am2 = AttrMap(Text((\'word\', u"hi")), {\'word\':\'greeting\', None:\'bg\'})\n        >>> am2\n        <AttrMap flow widget <Text flow widget \'hi\'> attr_map={\'word\': \'greeting\', None: \'bg\'}>\n        >>> am2.render(size).content().next()\n        [(\'greeting\', None, ...\'hi\'), (\'bg\', None, ...\'   \')]\n        ' #NEWLINE# self . __super . __init__ ( w ) #NEWLINE# if ( type ( attr_map ) != dict ) : #NEWLINE# #INDENT# self . set_attr_map ( { #NEWLINE# #INDENT# None : focus_map , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . set_attr_map ( attr_map ) #NEWLINE# #UNINDENT# if ( ( focus_map is not None ) and ( type ( focus_map ) != dict ) ) : #NEWLINE# #INDENT# self . set_focus_map ( { #NEWLINE# #INDENT# None : focus_map , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . set_focus_map ( focus_map )