Changeset 454 in tmcsimulator for trunk/src/python/unifiedlogger/cad_watcher.py


Ignore:
Timestamp:
07/18/2019 08:19:25 AM (7 years ago)
Author:
jdalbey
Message:

Logging Service: add missing file error check. Cad watcher modified to read log file path from config file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/python/unifiedlogger/cad_watcher.py

    r439 r454  
    1 import json, time 
     1import json, time, ConfigParser 
    22from copy import deepcopy 
    33 
     
    2020# Read the cad comments log  
    2121def readFile(): 
     22    # get path to input file from configuration 
     23    config = ConfigParser.ConfigParser() 
     24    config.read('config/logging_service.cfg') 
     25    logfilepath  = config.get('Paths', 'UnifiedLogPath') 
     26     
    2227    lines = [] 
    2328    try: 
    24         text_file = open("CADcomments.log", "r") 
     29        text_file = open(logfilepath + "CADcomments.log", "r") 
    2530    except IOError: 
    26         print "Error: missing CADcomments.log file." 
     31        print "Error: missing "+logfilepath+"CADcomments.log file." 
    2732    else: 
    2833        lines = text_file.read().split('\n') 
Note: See TracChangeset for help on using the changeset viewer.