Changeset 5070
- Timestamp:
- Feb 21, 2008, 4:31:26 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r4938 r5070 5258 5258 5259 5259 5260 def start_screen_catcher(dir_name , myid='', numprocs='', extra_info='',5260 def start_screen_catcher(dir_name=None, myid='', numprocs='', extra_info='', 5261 5261 verbose=True): 5262 """ 5262 """ 5263 5263 Used to store screen output and errors to file, if run on multiple 5264 5264 processes eachprocessor will have its own output and error file. … … 5268 5268 5269 5269 FIXME: Would be good if you could suppress all the screen output and 5270 only save it to file... however it seems a bit tricky as this cap uture5270 only save it to file... however it seems a bit tricky as this capture 5271 5271 techique response to sys.stdout and by this time it is already printed out. 5272 5273 """5272 """ 5273 5274 5274 import sys 5275 dir_name = dir_name 5275 # dir_name = dir_name 5276 if dir_name == None: 5277 dir_name=getcwd() 5278 5276 5279 if access(dir_name,W_OK) == 0: 5277 5280 if verbose: print 'Making directory %s' %dir_name 5278 5281 # if verbose: print "myid", myid 5279 5282 mkdir (dir_name,0777) 5280 # print 'helloa' 5283 5281 5284 if myid <>'': 5282 5285 myid = '_'+str(myid) … … 5286 5289 extra_info = '_'+str(extra_info) 5287 5290 # print 'hello1' 5288 screen_output_name = dir_name +"screen_output%s%s%s.txt" %(myid,5291 screen_output_name = join(dir_name, "screen_output%s%s%s.txt" %(myid, 5289 5292 numprocs, 5290 extra_info) 5291 screen_error_name = dir_name +"screen_error%s%s%s.txt" %(myid,5293 extra_info)) 5294 screen_error_name = join(dir_name, "screen_error%s%s%s.txt" %(myid, 5292 5295 numprocs, 5293 extra_info) 5296 extra_info)) 5294 5297 5295 5298 if verbose: print 'Starting ScreenCatcher, all output will be stored in %s' \
Note: See TracChangeset
for help on using the changeset viewer.