#NEWLINE# def _find_candidates_for_deletion( master_dir ) : #NEWLINE# #INDENT# 'Find files eligible for deletion i.e. with link count ==1.\n\n    :param master_dir: directory to operate on\n    :returns: iterator yielding tuples (file name, last used time, stat)\n    ' #NEWLINE# for filename in os . listdir ( last_used_time ) : #NEWLINE# #INDENT# filename = os . path . join ( master_dir , filename ) #NEWLINE# stat = os . stat ( filename ) #NEWLINE# if ( ( not os . path . isfile ( filename ) ) or ( stat . st_nlink > 1 ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# last_used_time = max ( stat . st_mtime , stat . st_atime , stat . st_ctime ) #NEWLINE# ( yield ( filename , last_used_time , stat ) )