315 |
315 |
316 # save the raw data as a CSV file |
316 # save the raw data as a CSV file |
317 fileName = "{0}.csv".format(time.strftime("%Y%m%d-%H%M%S")) |
317 fileName = "{0}.csv".format(time.strftime("%Y%m%d-%H%M%S")) |
318 fullPath = os.path.join(dataDir, fileName) |
318 fullPath = os.path.join(dataDir, fileName) |
319 try: |
319 try: |
320 csvFile = open(fullPath, "w") |
320 with open(fullPath, "w") as csvFile: |
321 csvWriter = csv.writer(csvFile) |
321 csvWriter = csv.writer(csvFile) |
322 csvWriter.writerows(self.__rawData) |
322 csvWriter.writerows(self.__rawData) |
323 csvFile.close() |
|
324 |
323 |
325 self.__dirty = False |
324 self.__dirty = False |
326 return True |
325 return True |
327 except (IOError, OSError) as err: |
326 except (IOError, OSError) as err: |
328 E5MessageBox.critical( |
327 E5MessageBox.critical( |