#NEWLINE# def report_doc_patterns( pname , bname , release , source , resource_pk ) : #NEWLINE# #INDENT# prelease1 = ProjectRelease . objects . filter ( project__dir_name = pname ) . filter ( release = release ) [ 0 ] #NEWLINE# codebase1 = CodeBase . objects . filter ( project_release = prelease1 ) . filter ( name = bname ) [ 0 ] #NEWLINE# doc_patterns = DocumentationPattern . objects . filter ( main_pattern__pattern__codebase = codebase1 ) . filter ( main_pattern__source = source ) . filter ( main_pattern__resource_object_id = resource_pk ) . filter ( main_pattern__valid = True ) . order_by ( '-main_pattern__coverage' ) #NEWLINE# for ( i , doc_pattern ) in enumerate ( doc_patterns . iterator ( ) ) : #NEWLINE# #INDENT# print ( '{0}. DOCUMENTATION PATTERN' . format ( doc_pattern ) ) #NEWLINE# pk = doc_pattern . main_pattern . pk #NEWLINE# print ( 'MAIN PATTERN' ) #NEWLINE# report_single_coverage ( doc_pattern . main_pattern ) #NEWLINE# print ( 'LOC:' ) #NEWLINE# report_location ( doc_pattern ) #NEWLINE# for coverage in doc_pattern . patterns . all ( ) : #NEWLINE# #INDENT# if ( coverage . pk == pk ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# print ( 'SUB PATTERN' ) #NEWLINE# report_single_coverage ( coverage ) #NEWLINE# #UNINDENT# print ( '' )