Changeset 1467
- Timestamp:
- May 26, 2005, 11:23:46 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pmesh/load_mesh/loadASCII.py
r1439 r1467 85 85 NOMAXAREA=-999 86 86 87 #FIXME (DSG-DSG) this is used by least_squares -88 # is this the best function for it to use?89 # (DSG-DSG) put an exception handler in import_triangulation/import_mesh_file90 # Think about exceptions before doing this!91 def mesh_file_to_mesh_dictionary(file_name):92 """Load a pmesh file. Returning the mesh dictionary.93 """94 try:95 meshdic = import_mesh_file(file_name)96 except IOError, e:97 msg = 'Could not open file %s ' %file_name98 raise IOError, msg99 return meshdic100 101 87 # This is used by pmesh 102 88 def import_mesh_file(ofile): … … 115 101 msg = 'Extension %s is unknown' %ofile[-4:] 116 102 raise IOError, msg 117 except (SyntaxError,IndexError ):103 except (SyntaxError,IndexError, ValueError): #FIXME No test for ValueError 118 104 msg = 'File could not be opened' 119 raise IOError, msg 105 raise IOError, msg 120 106 return dict 121 107 … … 1009 995 except (IndexError,ValueError,SyntaxError): 1010 996 fd.close() 1011 msg = 'File could not be opened' 997 msg = 'Could not open file %s ' %ofile 998 raise IOError, msg 999 1000 1001 1002 1003 1004 1005 1006 1007 except IOError: 1008 # Catch this to add an error message 1009 msg = 'Could not open file %s ' %ofile 1012 1010 raise IOError, msg 1013 1011
Note: See TracChangeset
for help on using the changeset viewer.