#NEWLINE# def add_all( self , regions ) : #NEWLINE# #INDENT# if len ( self ) : #NEWLINE# #INDENT# if ( len ( self ) < len ( regions ) ) : #NEWLINE# #INDENT# ( self [ : ] , regions ) = ( regions , self [ : ] ) #NEWLINE# #UNINDENT# gc . disable ( ) #NEWLINE# timeout = global_settings ( 'preview_process_timeout' , 2 ) #NEWLINE# ( tpc , start_time ) = ( perf_counter , perf_counter ( ) ) #NEWLINE# [ self . add ( region ) for region in regions if ( ( region is not None ) and ( ( tpc ( ) - start_time ) < timeout ) ) ] #NEWLINE# gc . enable ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self [ : ] = timeout