Changeset 2941 for inundation/load_mesh


Ignore:
Timestamp:
May 23, 2006, 9:11:57 AM (19 years ago)
Author:
duncan
Message:

added more tests to geo_ref. It throws a different error as well now. Updated cornell room

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/load_mesh/loadASCII.py

    r2888 r2941  
    8282from os.path import splitext
    8383
    84 from coordinate_transforms.geo_reference import Geo_reference,TITLE
     84from coordinate_transforms.geo_reference import Geo_reference,TITLE, TitleError
    8585
    8686import exceptions
     
    105105            msg = 'Extension %s is unknown' %ofile[-4:]
    106106            raise IOError, msg
    107     except (SyntaxError,IndexError, ValueError): #FIXME No test for ValueError
     107    except (TitleError,SyntaxError,IndexError, ValueError): #FIXME No test for ValueError
    108108            msg = 'File could not be opened'
    109109            raise IOError, msg 
     
    993993
    994994    #FIXME (Ole): This function should really return a Geospatial_data object.      #FIXME (DSG): Do you know it does, in the points dic?
     995    #No.  Where this function is used, geospatial objects should be used.
    995996   
    996997    if ofile[-4:]== ".xya":
     
    10001001                    fd = open(ofile)
    10011002                    points_dict = _read_xya_file(fd, ',')
    1002                 except SyntaxError:
     1003                except TitleError: # this is catching the error thrown by geo_ref
    10031004                    fd.close()
    10041005                    fd = open(ofile)
     
    10091010            fd.close()
    10101011        except (IndexError,ValueError,SyntaxError):
    1011             fd.close()   
     1012            fd.close()
     1013            msg = 'Could not open file %s ' %ofile
     1014            raise IOError, msg
     1015        except TitleError:
     1016            print "reclassifying title error"
     1017            fd.close()
    10121018            msg = 'Could not open file %s ' %ofile
    10131019            raise IOError, msg
Note: See TracChangeset for help on using the changeset viewer.