#NEWLINE# @ classmethod #NEWLINE# def file_is_valid( cls , view , file_path = None ) : #NEWLINE# #INDENT# file_path = ( file_path or ( view and view . file_name ( ) ) ) #NEWLINE# if ( not file_path ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( ( cls . get_ext_appendix ( text ) is not None ) or ( os . path . splitext ( file_path ) [ 1 ] == ( '.' + cls . ext ) ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if view : #NEWLINE# #INDENT# for i in range ( 3 ) : #NEWLINE# #INDENT# text = coorded_substr ( view , ( i , 0 ) , ( i , len ( cls . DOCTYPE ) ) ) #NEWLINE# if ( text == cls . DOCTYPE ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return False