Package QSTK :: Package qstkutil :: Module utils
[hide private]
[frames] | no frames]

Source Code for Module QSTK.qstkutil.utils

 1  ''' 
 2  Created on Apr 22, 2011 
 3   
 4  @author: shreyas 
 5  @summary: This is intended to be a collection of helper routines used by different QSTK modules 
 6  ''' 
 7   
 8  import dircache 
 9  import os 
10   
11 -def clean_paths (paths_to_clean):
12 ''' 13 @summary: Removes any previous files in the list of paths. 14 ''' 15 16 if (type(paths_to_clean) is str): 17 temp= paths_to_clean 18 paths_to_clean= list() 19 paths_to_clean.append(temp) 20 #endif 21 22 23 for path in paths_to_clean: 24 files_at_this_path = dircache.listdir(str(path)) 25 for _file in files_at_this_path: 26 if (os.path.isfile(path + _file)): 27 os.remove(path + _file)
28 #if ends 29 #for ends 30 #outer for ends 31 32 #clean_output_paths ends 33