Changeset 5070


Ignore:
Timestamp:
Feb 21, 2008, 4:31:26 PM (16 years ago)
Author:
nick
Message:

small changes to start_screen_catcher

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r4938 r5070  
    52585258
    52595259       
    5260 def start_screen_catcher(dir_name, myid='', numprocs='', extra_info='',
     5260def start_screen_catcher(dir_name=None, myid='', numprocs='', extra_info='',
    52615261                         verbose=True):
    5262     """ 
     5262    """
    52635263    Used to store screen output and errors to file, if run on multiple
    52645264    processes eachprocessor will have its own output and error file.
     
    52685268   
    52695269    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 caputure
     5270    only save it to file... however it seems a bit tricky as this capture
    52715271    techique response to sys.stdout and by this time it is already printed out.
    5272    
    5273     """
     5272    """
     5273   
    52745274    import sys
    5275     dir_name = dir_name
     5275#    dir_name = dir_name
     5276    if dir_name == None:
     5277        dir_name=getcwd()
     5278       
    52765279    if access(dir_name,W_OK) == 0:
    52775280        if verbose: print 'Making directory %s' %dir_name
    52785281      #  if verbose: print "myid", myid
    52795282        mkdir (dir_name,0777)
    5280 #    print 'helloa'
     5283
    52815284    if myid <>'':
    52825285        myid = '_'+str(myid)
     
    52865289        extra_info = '_'+str(extra_info)
    52875290#    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,
    52895292                                                                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,
    52925295                                                              numprocs,
    5293                                                               extra_info)
     5296                                                              extra_info))
    52945297
    52955298    if verbose: print 'Starting ScreenCatcher, all output will be stored in %s' \
Note: See TracChangeset for help on using the changeset viewer.