#NEWLINE# def set_active( self , href ) : #NEWLINE# #INDENT# active_node = None #NEWLINE# if ( ( self . node . href . startswith ( '^' ) and re . match ( self . node . href , href ) ) or ( self . node . href == href ) ) : #NEWLINE# #INDENT# self . active = True #NEWLINE# parent = self . parent #NEWLINE# while parent : #NEWLINE# #INDENT# parent . active = True #NEWLINE# parent = parent . parent #NEWLINE# #UNINDENT# active_node = self #NEWLINE# #UNINDENT# for child in self . children : #NEWLINE# #INDENT# child = child . set_active ( href ) #NEWLINE# if child : #NEWLINE# #INDENT# active_node = child #NEWLINE# #UNINDENT# #UNINDENT# return active_node