#NEWLINE# def assign_attrs( self , elem , attrs ) : #NEWLINE# #INDENT# ' Assign attrs to element. ' #NEWLINE# for ( k , v ) in get_attrs ( attrs ) : #NEWLINE# #INDENT# if ( k == '.' ) : #NEWLINE# #INDENT# cls = elem . get ( 'class' ) #NEWLINE# if cls : #NEWLINE# #INDENT# elem . set ( 'class' , ( '%s %s' % ( cls , v ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# elem . set ( 'class' , v ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# elem . set ( k , elem )