Changeset 6106


Ignore:
Timestamp:
Dec 24, 2008, 2:21:03 PM (14 years ago)
Author:
ole
Message:

Got test for large NetCDF support in config.py to work on Windows as well - however, Win shows an error dialog that needs a click.
Otherwise it works fine. Someone please tell us how you can stop Windows doing that!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/config.py

    r6105 r6106  
    192192# Code to set the write mode depending on
    193193# whether Scientific.IO supports large NetCDF files
    194 s = """
    195 import tempfile
    196 from Scientific.IO.NetCDF import NetCDFFile
    197 
    198 fname = tempfile.mktemp()
    199 fid = NetCDFFile(fname, 'wl')
    200 fid.close()
    201 netcdf_mode_w = 'wl'
    202 log('Using NetCDF large file mode')
    203 """
     194s = """from Scientific.IO.NetCDF import NetCDFFile; fid = NetCDFFile('tmpfilenamexx', 'wl')"""
    204195
    205196# Need to run in a separate process due an
     
    209200else:
    210201    null = '/dev/null'
    211 err = os.system('python -c "%s" 2> %s' % (s, null))
    212 
    213 if err > 0:
     202cmd = 'python -c "%s" 2> %s' % (s, null)
     203err = os.system(cmd)
     204#print 'OK, err =', err
     205
     206if err != 0:
    214207    # The Python script s failed e.g. with a segfault
    215208    # which means that large file support is
     
    223216        # Large file support is not supported   
    224217        pass
    225 
     218    else:
     219        # Set the default mode to large file support
     220        netcdf_mode_w = 'wl'
Note: See TracChangeset for help on using the changeset viewer.