Changeset 3989


Ignore:
Timestamp:
28 Feb 2009, 11:48:35 (16 years ago)
Author:
Henrik Bettermann
Message:

only one headline

Location:
WAeUP_SRP/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTables.py

    r3988 r3989  
    3333import urllib
    3434import DateTime,time
    35 import csv,re
     35import csv,re,os
    3636import logging
    3737import Globals
     
    16841684        if export:
    16851685            export_file = "%s/export/course_results_removed.csv" % (i_home)
    1686             file_handler = open(export_file,"a")
    1687             headline = ','.join(fields)
    1688             file_handler.write(headline +'\n')
     1686            if not os.path.exists(export_file): 
     1687                file_handler = open(export_file,"a")
     1688                headline = ','.join(fields)
     1689                file_handler.write(headline +'\n')
     1690            else:
     1691                file_handler = open(export_file,"a")
    16891692            for line in courses:
    16901693                file_handler.write(line +'\n')
     
    18131816        if export:
    18141817            export_file = "%s/export/payments_removed.csv" % (i_home)
    1815             file_handler = open(export_file,"a")
    1816             headline = ','.join(fields)
    1817             file_handler.write(headline +'\n')
     1818            if not os.path.exists(export_file): 
     1819                file_handler = open(export_file,"a")
     1820                headline = ','.join(fields)
     1821                file_handler.write(headline +'\n')
     1822            else:
     1823                file_handler = open(export_file,"a")
    18181824            for line in payments_dic:
    18191825                file_handler.write(line +'\n')
  • WAeUP_SRP/trunk/WAeUPTool.py

    r3988 r3989  
    12051205        format = '"%(' + ')s","%('.join(fields) + ')s"'
    12061206        export_file = "%s/export/study_levels_removed.csv" % (i_home)
    1207         file_handler = open(export_file,"a")
    1208         headline = ','.join(fields)
    1209         file_handler.write(headline +'\n')
     1207       
     1208        if not os.path.exists(export_file): 
     1209            file_handler = open(export_file,"a")
     1210            headline = ','.join(fields)
     1211            file_handler.write(headline +'\n')
     1212        else:
     1213            file_handler = open(export_file,"a")
    12101214       
    12111215        for level in levels:
Note: See TracChangeset for help on using the changeset viewer.