Ignore:
Timestamp:
Jan 17, 2008, 4:15:17 PM (17 years ago)
Author:
steve
Message:

Ran into a problem with the inundation_damage when reading a file with two '.'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/damage_modelling/inundation_damage.py

    r4855 r4951  
    9595            exposure_file_out = exposure_file_in
    9696        else:
    97             name, extension = exposure_file_in.split('.')
    98             exposure_file_out = name + exposure_file_out_marker + \
    99                                 '.' + extension
     97            # split off extension, in such a way to deal with more than one '.' in the name of file
     98            split_name = exposure_file_in.split('.')
     99            exposure_file_out =  '.'.join(split_name[:-1]) + exposure_file_out_marker + \
     100                                '.' + split_name[-1]
    100101        csv.save(exposure_file_out)
    101102        if verbose: print '\n Augmented building file written to %s \n' %exposure_file_out
Note: See TracChangeset for help on using the changeset viewer.