Changeset 4603
- Timestamp:
- Jul 6, 2007, 3:18:58 PM (17 years ago)
- Location:
- anuga_core/source/anuga/shallow_water
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r4598 r4603 194 194 195 195 # ANOTHER OPTION, IF NEED IN THE FUTURE, Nick B 7/2007 196 # def rmgeneric(path, __func__):197 #ERROR_STR= """Error removing %(path)s, %(error)s """198 # 199 #try:200 #__func__(path)201 #print 'Removed ', path202 #except OSError, (errno, strerror):203 #print ERROR_STR % {'path' : path, 'error': strerror }204 #205 # def removeall(path):206 # 207 #if not os.path.isdir(path):208 #return209 #210 #files=os.listdir(path)211 # 212 #for x in files:213 #fullpath=os.path.join(path, x)214 #if os.path.isfile(fullpath):215 #f=os.remove216 #rmgeneric(fullpath, f)217 #elif os.path.isdir(fullpath):218 #removeall(fullpath)219 #f=os.rmdir220 # rmgeneric(fullpath, f)196 def rmgeneric(path, __func__,verbose=False): 197 ERROR_STR= """Error removing %(path)s, %(error)s """ 198 199 try: 200 __func__(path) 201 if verbose: print 'Removed ', path 202 except OSError, (errno, strerror): 203 print ERROR_STR % {'path' : path, 'error': strerror } 204 205 def removeall(path,verbose=False): 206 207 if not os.path.isdir(path): 208 return 209 210 files=os.listdir(path) 211 212 for x in files: 213 fullpath=os.path.join(path, x) 214 if os.path.isfile(fullpath): 215 f=os.remove 216 rmgeneric(fullpath, f) 217 elif os.path.isdir(fullpath): 218 removeall(fullpath) 219 f=os.rmdir 220 rmgeneric(fullpath, f,verbose) 221 221 222 222 -
anuga_core/source/anuga/shallow_water/test_data_manager.py
r4598 r4603 7175 7175 iterate=get_all_swwfiles(dir,'test') 7176 7176 7177 del_dir(temp_dir) 7177 # del_dir(temp_dir) 7178 removeall(temp_dir) 7178 7179 7179 7180 _, name0 = os.path.split(filename0)
Note: See TracChangeset
for help on using the changeset viewer.