#NEWLINE# def _handle_run( self , relpath , params ) : #NEWLINE# #INDENT# 'Show the report for a single pants run.' #NEWLINE# args = self . _default_template_args ( 'run' ) #NEWLINE# run_id = relpath #NEWLINE# run_info = self . _get_run_info_dict ( run_id ) #NEWLINE# if ( run_info is None ) : #NEWLINE# #INDENT# args [ 'no_such_run' ] = relpath #NEWLINE# if ( run_id == 'latest' ) : #NEWLINE# #INDENT# args [ 'is_latest' ] = 'none' #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# report_abspath = run_info [ 'default_report' ] #NEWLINE# report_relpath = os . path . relpath ( report_abspath , self . _root ) #NEWLINE# report_dir = os . path . dirname ( run_id ) #NEWLINE# self_timings_path = os . path . join ( report_dir , 'self_timings' ) #NEWLINE# cumulative_timings_path = os . path . join ( report_dir , 'cumulative_timings' ) #NEWLINE# artifact_cache_stats_path = os . path . join ( report_dir , 'artifact_cache_stats' ) #NEWLINE# run_info [ 'timestamp_text' ] = datetime . fromtimestamp ( float ( run_info [ 'timestamp' ] ) ) . strftime ( '%H:%M:%S on %A, %B %d %Y' ) #NEWLINE# timings_and_stats = '\n' . join ( [ self . _collapsible_fmt_string . format ( id = 'cumulative-timings-collapsible' , title = 'Cumulative timings' , class_prefix = 'aggregated-timings' ) , self . _collapsible_fmt_string . format ( id = 'self-timings-collapsible' , title = 'Self timings' , class_prefix = 'aggregated-timings' ) , self . _collapsible_fmt_string . format ( id = 'artifact-cache-stats-collapsible' , title = 'Artifact cache stats' , class_prefix = 'artifact-cache-stats' ) ] ) #NEWLINE# args . update ( { #NEWLINE# #INDENT# 'run_info' : run_info , #NEWLINE# 'report_path' : report_relpath , #NEWLINE# 'self_timings_path' : self_timings_path , #NEWLINE# 'cumulative_timings_path' : cumulative_timings_path , #NEWLINE# 'artifact_cache_stats_path' : artifact_cache_stats_path , #NEWLINE# 'timings_and_stats' : timings_and_stats , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( run_id == 'latest' ) : #NEWLINE# #INDENT# args [ 'is_latest' ] = run_info [ 'id' ] #NEWLINE# #UNINDENT# #UNINDENT# self . _send_content ( self . _renderer . render_name ( 'base' , args ) , 'text/html' )