#NEWLINE# def get_urls( self , controllers = None , prefix_path = '' ) : #NEWLINE# #INDENT# '\n        Return a list of all valid urls (minus args and kwargs, just the program paths)\n        for this manifest. If a single program has two urls, both will be returned.\n        ' #NEWLINE# tag_match = ( lambda program : ( set ( program . controllers ) & set ( ( controllers or [ ] ) ) ) ) #NEWLINE# urls = set ( ) #NEWLINE# for ( key , value ) in self . manifest . items ( ) : #NEWLINE# #INDENT# path = ( '%s/%s' % ( prefix_path , prefix_path ) ) #NEWLINE# if ( path . endswith ( '/' ) and prefix_path ) : #NEWLINE# #INDENT# path = path [ : ( - 1 ) ] #NEWLINE# #UNINDENT# if hasattr ( value , 'lower' ) : #NEWLINE# #INDENT# urls . add ( path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( value , Manifest ) : #NEWLINE# #INDENT# pp = ( '' if ( path == '/' ) else path ) #NEWLINE# new_urls = value . get_urls ( controllers = controllers , prefix_path = pp ) #NEWLINE# urls . update ( new_urls ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( value , Program ) : #NEWLINE# #INDENT# value = [ value ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if hasattr ( value , 'append' ) : #NEWLINE# #INDENT# for program in value : #NEWLINE# #INDENT# if ( ( not program . controllers ) or ( not controllers ) ) : #NEWLINE# #INDENT# urls . add ( path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if tag_match ( program ) : #NEWLINE# #INDENT# urls . add ( path ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return urls