#NEWLINE# def retrieve_link( request , link ) : #NEWLINE# #INDENT# ( stat , obj ) = views . parse ( ) #NEWLINE# page = get_object_or_404 ( ConfiguratorPage , link = link ) #NEWLINE# services = page . load_services ( ) #NEWLINE# graphs = [ ] #NEWLINE# for service in services : #NEWLINE# #INDENT# service [ 'isGraphable' ] = views . is_graphable ( service [ 'host' ] , service [ 'service' ] ) #NEWLINE# service [ 'slug' ] = views . slugify ( ( service [ 'host' ] + service [ 'service' ] ) ) #NEWLINE# servicedetail = views . servicelist_by_host_desc ( stat , service [ 'host' ] , service [ 'service' ] ) [ 0 ] #NEWLINE# servicedetail [ 'is_graphable' ] = service [ 'isGraphable' ] #NEWLINE# servicedetail [ 'slug' ] = service [ 'slug' ] #NEWLINE# service [ 'duration' ] = servicedetail [ 'state_duration' ] #NEWLINE# if ( '_TEST' in servicedetail ) : #NEWLINE# #INDENT# servicedetail [ 'nagcat_template' ] = servicedetail [ '_TEST' ] . split ( ';' , 1 ) [ ( - 1 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# servicedetail [ 'nagcat_template' ] = '' #NEWLINE# #UNINDENT# html = render_to_response ( 'graph.html' , servicedetail ) . content #NEWLINE# service [ 'html' ] = html #NEWLINE# service [ 'nagcat_template' ] = servicedetail [ 'nagcat_template' ] #NEWLINE# graphs . append ( service ) #NEWLINE# #UNINDENT# return views . configurator ( request , stat , obj , graphs = graphs , permalink = True , link = link )