#NEWLINE# def show( self , environ , start_response ) : #NEWLINE# #INDENT# start_response ( '200 OK' , [ ( 'Content-type' , 'text/html' ) ] ) #NEWLINE# form = parse_formvars ( environ ) #NEWLINE# if form . get ( 'kill' ) : #NEWLINE# #INDENT# kill_thread_id = form [ 'kill' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# kill_thread_id = None #NEWLINE# #UNINDENT# thread_pool = environ [ 'paste.httpserver.thread_pool' ] #NEWLINE# nworkers = thread_pool . nworkers #NEWLINE# now = time . time ( ) #NEWLINE# workers = thread_pool . worker_tracker . items ( ) #NEWLINE# workers . sort ( key = ( lambda v : v [ 1 ] [ 0 ] ) ) #NEWLINE# threads = [ ] #NEWLINE# for ( thread_id , ( time_started , worker_environ ) ) in workers : #NEWLINE# #INDENT# thread = bunch ( ) #NEWLINE# threads . append ( thread ) #NEWLINE# if worker_environ : #NEWLINE# #INDENT# thread . uri = construct_url ( worker_environ ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# thread . uri = 'unknown' #NEWLINE# #UNINDENT# thread . thread_id = thread_id #NEWLINE# thread . time_html = format_time ( ( now - time_started ) ) #NEWLINE# thread . uri_short = shorten ( thread . uri ) #NEWLINE# thread . environ = worker_environ #NEWLINE# thread . traceback = traceback_thread ( thread_id ) #NEWLINE# #UNINDENT# page = page_template . substitute ( title = 'Thread Pool Worker Tracker' , nworkers = nworkers , actual_workers = len ( thread_pool . workers ) , nworkers_used = len ( now ) , script_name = environ [ 'SCRIPT_NAME' ] , kill_thread_id = kill_thread_id , allow_kill = self . allow_kill , threads = threads , this_thread_id = get_ident ( ) , track_threads = thread_pool . track_threads ( ) ) #NEWLINE# return [ page ]