(self, elem, attrs)
Assign attrs to element.
Assign attrs to element.
Assign attrs to element .
def assign_attrs(self, elem, attrs):
        """ Assign attrs to element. """
        for k, v in get_attrs(attrs):
            if k == '.':
                # add to class
                cls = elem.get('class')
                if cls:
                    elem.set('class', '%s %s' % (cls, v))
                else:
                    elem.set('class', v)
            else:
                # assing attr k with v
                elem.set(k, v)
def assign_attrs ( self , elem , attrs ) : for k , v in get_attrs ( attrs ) : if k == '.' : # add to class cls = elem . get ( 'class' ) if cls : elem . set ( 'class' , '%s %s' % ( cls , v ) ) else : elem . set ( 'class' , v ) else : # assing attr k with v elem . set ( k , v )