Changeset 436 in tmcsimulator for trunk/webapps


Ignore:
Timestamp:
07/10/2019 01:48:55 PM (7 years ago)
Author:
jdalbey
Message:

cad_watcher.py added exception handling for missing log file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/webapps/unifiedlogger/cad_watcher.py

    r433 r436  
    1515 
    1616# Read the cms message file 
    17 def readFile():      
    18     text_file = open("../../CADcomments.log", "r") 
    19     lines = text_file.read().split('\n') 
     17def readFile(): 
     18    lines = [] 
     19    try: 
     20        text_file = open("../../CADcomments.log", "r") 
     21    except IOError: 
     22        print "Error: missing CADcomments.log file." 
     23    else: 
     24        lines = text_file.read().split('\n') 
     25        text_file.close()     
    2026    return lines 
    2127     
Note: See TracChangeset for help on using the changeset viewer.