Changeset 687 in tmcsimulator for trunk/src/python/unifiedlogger/har_watcher.py
- Timestamp:
- 10/02/2022 10:32:42 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/python/unifiedlogger/har_watcher.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/python/unifiedlogger/har_watcher.py
r649 r687 1 import json, time 1 import json, time, ConfigParser 2 2 from copy import deepcopy 3 3 … … 9 9 currList = [] # current messages 10 10 locationMap = {} # map of HAR ID's to locations 11 filepath = "webapps/dynamicdata" # default during development 11 12 12 13 # Utility functions … … 17 18 18 19 # Read the har message file 19 def readFile(): 20 with open ("webapps/dynamicdata/har_messages.json",'r') as myfile: 20 def readFile(): 21 global filepath 22 with open (filepath+"/har_messages.json",'r') as myfile: 21 23 jsonData=myfile.read() 22 24 23 return json.loads(jsonData)['data']25 return json.loads(jsonData)['data'] 24 26 25 27 # Read the static file of cms locations and create a lookup map … … 51 53 currList.append(aMessage.replace("\n"," ").strip()) 52 54 53 def setup(): 54 extractMessages(initialize()) 55 def setup(dir): 56 global filepath 57 # get path to input file from configuration 58 config = ConfigParser.ConfigParser() 59 config.read(dir+'/logging_service.cfg') 60 filepath = config.get('Paths', 'UnifiedLogPath') 61 62 extractMessages(initialize()) 55 63 56 64 # compare previous messages to current messages to look for changes … … 81 89 def main(): 82 90 global currList 83 setup( )91 setup("config/devlinux") 84 92 # Loop Forever 85 93 while True:
Note: See TracChangeset
for help on using the changeset viewer.
