#NEWLINE# def _cull( self ) : #NEWLINE# #INDENT# if ( int ( self . _num_entries ) < self . _max_entries ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# filelist = sorted ( os . listdir ( self . _dir ) ) #NEWLINE# #UNINDENT# except ( IOError , OSError ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( self . _cull_frequency == 0 ) : #NEWLINE# #INDENT# doomed = filelist #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# doomed = [ os . path . join ( self . _dir , k ) for ( i , k ) in enumerate ( filelist ) if ( ( i % self . _cull_frequency ) == 0 ) ] #NEWLINE# #UNINDENT# for topdir in doomed : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# for ( root , _ , files ) in os . walk ( topdir ) : #NEWLINE# #INDENT# for f in _ : #NEWLINE# #INDENT# self . _delete ( os . path . join ( root , f ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except ( IOError , OSError ) : #NEWLINE# #INDENT# pass