#NEWLINE# def __init__( self , document , name , attributes , parent , previous_sibling ) : #NEWLINE# #INDENT# super ( HTMLElement , self ) . __init__ ( document , name , attributes , parent , previous_sibling ) #NEWLINE# if attributes . has_key ( 'id' ) : #NEWLINE# #INDENT# self . id = attributes [ 'id' ] #NEWLINE# #UNINDENT# if attributes . has_key ( 'class' ) : #NEWLINE# #INDENT# self . classes = attributes [ 'class' ] . lower ( ) . split ( ) #NEWLINE# #UNINDENT# if attributes . has_key ( 'style' ) : #NEWLINE# #INDENT# self . set_element_style ( attributes [ 'style' ] ) #NEWLINE# #UNINDENT# if ( name == 'font' ) : #NEWLINE# #INDENT# declarations = [ ] #NEWLINE# if ( 'size' in attributes ) : #NEWLINE# #INDENT# size = self . font_sizes . get ( attributes [ 'size' ] , 'medium' ) #NEWLINE# declarations . append ( Declaration ( 'font-size' , [ size ] , None ) ) #NEWLINE# #UNINDENT# if ( 'face' in attributes ) : #NEWLINE# #INDENT# faces = [ ] #NEWLINE# for face in attributes [ 'face' ] . split ( ',' ) : #NEWLINE# #INDENT# faces . append ( Ident ( face . strip ( ) ) ) #NEWLINE# faces . append ( Delim ( ',' ) ) #NEWLINE# #UNINDENT# declarations . append ( Declaration ( 'font-family' , faces , None ) ) #NEWLINE# #UNINDENT# if ( 'color' in attributes ) : #NEWLINE# #INDENT# if ( attributes [ 'color' ] [ : 1 ] == '#' ) : #NEWLINE# #INDENT# color = Hash ( attributes [ 'color' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# color = Ident ( attributes [ 'color' ] ) #NEWLINE# #UNINDENT# declarations . append ( Declaration ( 'color' , [ color ] , None ) ) #NEWLINE# #UNINDENT# self . intrinsic_declaration_set = DeclarationSet ( declarations )