- Timestamp:
- 07/27/2019 08:23:36 PM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
-
python/unifiedlogger/cad_watcher.py (modified) (3 diffs)
-
python/unifiedlogger/wing_project.wpr (modified) (9 diffs)
-
tmcsim/application.properties (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/python/unifiedlogger/cad_watcher.py
r466 r467 1 import json, time, ConfigParser 1 import json, time, ConfigParser, os 2 2 from copy import deepcopy 3 3 … … 18 18 return not isEmpty(cmsitem) 19 19 20 # Read the cad comments log21 def readFile():22 # get path to input file from configuration23 config = ConfigParser.ConfigParser()24 config.read('config/logging_service.cfg')25 logfilepath = config.get('Paths', 'UnifiedLogPath')26 27 lines = []28 try:29 text_file = open(logfilepath + "CADcomments.log", "r")30 except IOError:31 print "Error: missing "+logfilepath+"CADcomments.log file."32 else:33 lines = text_file.read().split('\n')34 text_file.close()35 return lines36 37 20 def setup(): 38 21 lastLineNum = 0 … … 42 25 def getLogEntries(): 43 26 global lastLineNum 44 msgList = readFile() 45 currList = [] 46 currList = msgList[lastLineNum:] # new items since last file read 47 lastLineNum = len(msgList)-1 48 return currList 27 # get path to input file from configuration 28 config = ConfigParser.ConfigParser() 29 config.read('config/logging_service.cfg') 30 logfilepath = config.get('Paths', 'UnifiedLogPath') 31 pathToLog = logfilepath + "CADcomments.log" 32 33 try: 34 text_file = open(pathToLog, "r") 35 except IOError as ex: 36 if ex.errno == 2: 37 # 'No such file or directory 38 print pathToLog + " missing: assuming reset" 39 lastLineNum = 0 #Start over 40 return [] 41 else: 42 print "IOError reading "+pathToLog+" file." 43 print "errno: ",ex.errno 44 45 else: 46 # Check file size 47 fileSize = os.path.getsize(pathToLog) 48 if fileSize == 0: 49 # Assume this is a read sync problem: Don't modify lastLineNum 50 print pathToLog+" is empty." 51 return [] 52 else: # file is good, read it. 53 msgList = text_file.read().split('\n') 54 text_file.close() 55 currList = [] 56 currList = msgList[lastLineNum:] # new items since last file read 57 lastLineNum = len(msgList)-1 58 return currList 49 59 50 60 # Local main for unit testing -
trunk/src/python/unifiedlogger/wing_project.wpr
r466 r467 85 85 'current_pages': [3, 86 86 1], 87 'notebook_display': ' normal',87 'notebook_display': 'hidden', 88 88 'notebook_percent': 0.30000000000000004, 89 89 'override_title': None, … … 187 187 20)], 188 188 'code-line': ' trimmed_item = item.strip()\n', 189 'first-line': 39L,189 'first-line': 50L, 190 190 'folded-linenos': [], 191 191 'sel-line': 57L, … … 194 194 'selection_start': 1955L, 195 195 'zoom': 0L}, 196 1563915837.345044], 197 [loc('activitylog_watcher.py'), 198 {'attrib-starts': [('getLogEntries|0|', 199 42)], 200 'code-line': ' return currList\n', 201 'first-line': 37L, 202 'folded-linenos': [], 203 'sel-line': 48L, 204 'sel-line-start': 1427L, 205 'selection_end': 1427L, 206 'selection_start': 1427L, 207 'zoom': 0L}, 208 1563915839.151954], 209 [loc('logging_service.py'), 210 {'attrib-starts': [('startup|0|', 211 20)], 212 'code-line': ' trimmed_item = item.strip()\n', 213 'first-line': 50L, 214 'folded-linenos': [], 215 'sel-line': 57L, 216 'sel-line-start': 1955L, 217 'selection_end': 1955L, 218 'selection_start': 1955L, 219 'zoom': 0L}, 220 1563915884.294776], 196 1563915884.294776], 221 197 [loc('activitylog_watcher.py'), 222 198 {'attrib-starts': [('getLogEntries|0|', … … 423 399 'selection_start': 1851L, 424 400 'zoom': 0L}, 425 1564189539.194298]], 401 1564189539.194298], 402 [loc('cad_watcher.py'), 403 {'attrib-starts': [('setup|0|', 404 41)], 405 'code-line': 'def setup():\n', 406 'first-line': 24L, 407 'folded-linenos': [], 408 'sel-line': 41L, 409 'sel-line-start': 1329L, 410 'selection_end': 1329L, 411 'selection_start': 1329L, 412 'zoom': 0L}, 413 1564287471.970187], 414 [loc('../../../../../../../../usr/lib/python2.7/genericpath.py'), 415 {'attrib-starts': [('getsize|0|', 416 54)], 417 'code-line': ' return os.stat(filename).st_size\n', 418 'first-line': 39L, 419 'folded-linenos': [], 420 'sel-line': 56L, 421 'sel-line-start': 1506L, 422 'selection_end': 1506L, 423 'selection_start': 1506L, 424 'zoom': 0L}, 425 1564287481.404096]], 426 426 20), 427 427 'current-loc': loc('cad_watcher.py'), … … 438 438 'zoom': 0L}), 439 439 (loc('cad_watcher.py'), 440 {'attrib-starts': [], 441 'code-line': 'lastLineNum = 0\n', 442 'first-line': 33L, 440 {'attrib-starts': [('getLogEntries|0|', 441 24)], 442 'code-line': " msgList = text_fil"\ 443 "e.read().split('\\n')\n", 444 'first-line': 29L, 443 445 'folded-linenos': [], 444 'sel-line': 11L,445 'sel-line-start': 417L,446 'selection_end': 432L,447 'selection_start': 432L,446 'sel-line': 52L, 447 'sel-line-start': 1613L, 448 'selection_end': 1613L, 449 'selection_start': 1613L, 448 450 'zoom': 0L}), 449 451 (loc('cms_watcher.py'), … … 500 502 loc('__main__.py')]), 501 503 'open_files': [u'../../../config/logging_service.cfg', 504 u'__main__.py', 502 505 u'activitylog_watcher.py', 503 506 u'cms_watcher.py', 504 u'__main__.py',505 507 u'logging_service.py', 506 508 u'cad_watcher.py']}, … … 511 513 'traversal_pos': ((0, 512 514 3), 513 1564 183253.966105),515 1564287665.60169), 514 516 'user_data': {}}, 515 517 'saved_notebook_display': None, … … 519 521 'traversal_pos': ((0, 520 522 4), 521 1564 183317.08295),523 1564289756.891358), 522 524 'user_data': {}}, 523 525 'window-alloc': (29, … … 575 577 'selection_start': 22028L, 576 578 'zoom': 0L}, 579 loc('../../../../../../../../usr/lib/python2.7/genericpath.py'): {'a'\ 580 'ttrib-starts': [('getsize|0|', 581 54)], 582 'code-line': ' return os.stat(filename).st_size\n', 583 'first-line': 39L, 584 'folded-linenos': [], 585 'sel-line': 56L, 586 'sel-line-start': 1506L, 587 'selection_end': 1506L, 588 'selection_start': 1506L, 589 'zoom': 0L}, 577 590 loc('../../../../../../../../usr/lib/python2.7/json/decoder.py'): {'a'\ 578 591 'ttrib-starts': [('JSONDecoder|0|', -
trunk/src/tmcsim/application.properties
r466 r467 1 #Sat, 27 Jul 2019 15: 30:49-07001 #Sat, 27 Jul 2019 15:42:31 -0700 2 2 3 Application.revision=46 53 Application.revision=466 4 4 5 Application.buildnumber=17 45 Application.buildnumber=175
Note: See TracChangeset
for help on using the changeset viewer.
