#NEWLINE# def validate( self , object , name , value ) : #NEWLINE# #INDENT# ' Validates that a specified value is valid for this trait.\n        ' #NEWLINE# if isinstance ( value , basestring ) : #NEWLINE# #INDENT# return [ StatusItem ( name = value ) ] #NEWLINE# #UNINDENT# if isinstance ( value , StatusItem ) : #NEWLINE# #INDENT# return [ value ] #NEWLINE# #UNINDENT# if ( value is None ) : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# result = [ ] #NEWLINE# if isinstance ( value , SequenceTypes ) : #NEWLINE# #INDENT# for item in value : #NEWLINE# #INDENT# if isinstance ( item , basestring ) : #NEWLINE# #INDENT# result . append ( StatusItem ( name = item ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( item , StatusItem ) : #NEWLINE# #INDENT# result . append ( item ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return result #NEWLINE# #UNINDENT# #UNINDENT# self . error ( object , result , value )