Changeset 6130 for anuga_core/source/anuga/shallow_water/data_manager.py
- Timestamp:
- Jan 9, 2009, 3:03:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r6120 r6130 6760 6760 # try to open! 6761 6761 try: 6762 fid = open(file, "r")6762 fid = open(file, 'r') 6763 6763 file_header = fid.readline() 6764 6764 fid.close() 6765 6765 if verbose: print 'read file header %s' % file_header 6766 6766 except: 6767 msg = 'try to create new file ',file6767 msg = 'try to create new file: %s' % file 6768 6768 if verbose: print msg 6769 6769 #tries to open file, maybe directory is bad 6770 6770 try: 6771 fid = open(file, "w")6771 fid = open(file, 'w') 6772 6772 fid.write(header) 6773 6773 fid.close() 6774 6774 file_header=header 6775 6775 except: 6776 msg = 'cannot create new file ',file6777 raise msg6776 msg = 'cannot create new file: %s' % file 6777 raise Exception, msg 6778 6778 6779 6779 # if header is same or this is a new file 6780 6780 if file_header == str(header): 6781 fid = open(file, "a")6781 fid = open(file, 'a') 6782 6782 fid.write(line) 6783 6783 fid.close() … … 6787 6787 # end of details_temp.cvs file in output directory 6788 6788 file = str(kwargs['output_dir']) + 'detail_temp.csv' 6789 fid = open(file, "a")6789 fid = open(file, 'a') 6790 6790 fid.write(header) 6791 6791 fid.write(line)
Note: See TracChangeset
for help on using the changeset viewer.