#NEWLINE# @ classmethod #NEWLINE# def _write_dash_to_file( cls , dash_id , filename , timeout , format = 'raw' , string_ids = False ) : #NEWLINE# #INDENT# with open ( filename , 'w' ) as f : #NEWLINE# #INDENT# res = api . Timeboard . get ( dash_id ) #NEWLINE# report_warnings ( res ) #NEWLINE# report_errors ( dash_obj ) #NEWLINE# dash_obj = res [ 'dash' ] #NEWLINE# if ( 'resource' in dash_obj ) : #NEWLINE# #INDENT# del dash_obj [ 'resource' ] #NEWLINE# #UNINDENT# if ( 'url' in dash_obj ) : #NEWLINE# #INDENT# del dash_obj [ 'url' ] #NEWLINE# #UNINDENT# if string_ids : #NEWLINE# #INDENT# dash_obj [ 'id' ] = str ( dash_obj [ 'id' ] ) #NEWLINE# #UNINDENT# json . dump ( dash_obj , f , indent = 2 ) #NEWLINE# if ( format == 'pretty' ) : #NEWLINE# #INDENT# print ( 'Downloaded dashboard {0} to file {1}' . format ( dash_id , filename ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( '{0} {1}' . format ( dash_id , filename ) )