#NEWLINE# def validate_declaration( declaration ) : #NEWLINE# #INDENT# if ( declaration . property in _properties ) : #NEWLINE# #INDENT# ( attr , inheritable , multivalue , parse_func ) = _properties [ declaration . property ] #NEWLINE# if ( not multivalue ) : #NEWLINE# #INDENT# if ( len ( declaration . values ) != 1 ) : #NEWLINE# #INDENT# warnings . warn ( ( 'CSS validation error in %s' % declaration . property ) ) #NEWLINE# return ( ) #NEWLINE# #UNINDENT# value = declaration . values [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# value = declaration . values #NEWLINE# #UNINDENT# if ( inheritable and isinstance ( value , Ident ) and ( value == 'inherit' ) ) : #NEWLINE# #INDENT# if ( type ( attr ) in ( list , tuple ) ) : #NEWLINE# #INDENT# return zip ( attr , ( ( value , ) * len ( attr ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( attr , value ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# value = parse_func ( value , None ) #NEWLINE# if ( type ( attr ) in ( list , tuple ) ) : #NEWLINE# #INDENT# return zip ( attr , value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( ( attr , attr ) , ) #NEWLINE# #UNINDENT# #UNINDENT# except ValidationException : #NEWLINE# #INDENT# warnings . warn ( ( 'CSS validation error in %s' % declaration . property ) ) #NEWLINE# return ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# warnings . warn ( ( 'Unknown CSS property %s' % declaration . property ) ) #NEWLINE# return ( )