#NEWLINE# def endDocument( self ) : #NEWLINE# #INDENT# assert ( self . _active_rules == 0 ) #NEWLINE# assert ( len ( self . _path ) == 0 ) #NEWLINE# for a in self . _rules . itervalues ( ) : #NEWLINE# #INDENT# for r in [ x for x in a if ( x and hasattr ( x . finish , '__call__' ) ) ] : #NEWLINE# #INDENT# r . finish ( )