Changeset 522 in tmcsimulator for trunk/src/python/unifiedlogger


Ignore:
Timestamp:
11/11/2019 08:39:41 AM (6 years ago)
Author:
jdalbey
Message:

Unified logger - cad_watcher.py set lastLineNum to zero when fileSize == 0.

Location:
trunk/src/python/unifiedlogger
Files:
2 edited

Legend:

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

    r471 r522  
    1111 
    1212lastLineNum = 0 
    13  
    14 # Utility functions 
    15 def isEmpty(cmsitem): 
    16     return cmsitem == ",,,,," 
    17 def isFull(cmsitem): 
    18     return not isEmpty(cmsitem) 
    1913 
    2014def setup(): 
     
    4943            # Assume this is a read sync problem: Don't modify lastLineNum 
    5044            print pathToLog+" is empty, ignoring." 
     45            lastLineNum = 0   #Start over 
    5146            return [] 
    5247        else: # file is good, read it. 
  • trunk/src/python/unifiedlogger/wing_project.wpr

    r493 r522  
    198198                       'toolbox-percent': 1.0, 
    199199                       'toolbox-tree-sel': ''})], 
    200         'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('logging_service.py'), 
    201         {'attrib-starts': [('getSimTime|0|', 
    202                             13)], 
    203          'code-line': '       print "Proceeding with previous time: ", toHMS'\ 
    204                       '(seconds)\n', 
    205          'first-line': 3L, 
     200        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('../../../../../../../../usr/lib/python2.7/ConfigParser.py'), 
     201        {'attrib-starts': [('ConfigParser|0|', 
     202                            85), 
     203                           ('ConfigParser|0|.get|0|', 
     204                            589)], 
     205         'code-line': '                raise NoSectionError(section)\n', 
     206         'first-line': 589L, 
    206207         'folded-linenos': [], 
    207          'sel-line': 21L, 
    208          'sel-line-start': 649L, 
    209          'selection_end': 649L, 
    210          'selection_start': 649L, 
     208         'sel-line': 606L, 
     209         'sel-line-start': 22028L, 
     210         'selection_end': 22028L, 
     211         'selection_start': 22028L, 
    211212         'zoom': 0L}, 
    212         1566600699.578844], 
    213         [loc('../../../config/logging_service.cfg'), 
    214          {'attrib-starts': [], 
    215           'code-line': 'ActivityLogPath = webapps/dynamicdata/\n', 
    216           'first-line': 0L, 
    217           'folded-linenos': [], 
    218           'sel-line': 2L, 
    219           'sel-line-start': 46L, 
    220           'selection_end': 84L, 
    221           'selection_start': 84L, 
    222           'zoom': 0L}, 
    223          1566600715.315246], 
    224         [loc('activitylog_watcher.py'), 
    225          {'attrib-starts': [('readFile|0|', 
    226                              21)], 
    227           'code-line': "    logfilepath = config.get('Paths', 'ActivityLogPa"\ 
    228                        "th')\n", 
    229           'first-line': 15L, 
    230           'folded-linenos': [], 
    231           'sel-line': 25L, 
    232           'sel-line-start': 767L, 
    233           'selection_end': 767L, 
    234           'selection_start': 767L, 
    235           'zoom': 0L}, 
    236          1566600747.038673], 
    237         [loc('../../../../../../../../usr/lib/python2.7/ConfigParser.py'), 
    238          {'attrib-starts': [('ConfigParser|0|', 
    239                              85), 
    240                             ('ConfigParser|0|.get|0|', 
    241                              589)], 
    242           'code-line': '                raise NoSectionError(section)\n', 
    243           'first-line': 589L, 
    244           'folded-linenos': [], 
    245           'sel-line': 606L, 
    246           'sel-line-start': 22028L, 
    247           'selection_end': 22028L, 
    248           'selection_start': 22028L, 
    249           'zoom': 0L}, 
    250          1566600751.835139], 
     213        1566600751.835139], 
    251214        [loc('activitylog_watcher.py'), 
    252215         {'attrib-starts': [('readFile|0|', 
     
    450413          'selection_start': 649L, 
    451414          'zoom': 0L}, 
    452          1569957016.54503]], 
     415         1569957016.54503], 
     416        [loc('__main__.py'), 
     417         {'attrib-starts': [], 
     418          'code-line': 'import logging_service, os, ConfigParser\n', 
     419          'first-line': 0L, 
     420          'folded-linenos': [], 
     421          'sel-line': 0L, 
     422          'sel-line-start': 0L, 
     423          'selection_end': 40L, 
     424          'selection_start': 28L, 
     425          'zoom': 0L}, 
     426         1573490786.397811], 
     427        [loc('cad_watcher.py'), 
     428         {'attrib-starts': [('getLogEntries|0|', 
     429                             24)], 
     430          'code-line': '        fileSize = os.path.getsize(pathToLog)\n', 
     431          'first-line': 18L, 
     432          'folded-linenos': [], 
     433          'sel-line': 46L, 
     434          'sel-line-start': 1365L, 
     435          'selection_end': 1410L, 
     436          'selection_start': 1410L, 
     437          'zoom': 0L}, 
     438         1573492071.42135], 
     439        [loc('cms_watcher.py'), 
     440         {'attrib-starts': [('readFile|0|', 
     441                             18)], 
     442          'code-line': ' \n', 
     443          'first-line': 6L, 
     444          'folded-linenos': [], 
     445          'sel-line': 21L, 
     446          'sel-line-start': 564L, 
     447          'selection_end': 565L, 
     448          'selection_start': 565L, 
     449          'zoom': 0L}, 
     450         1573492072.884505]], 
    453451        20), 
    454         'current-loc': loc('__main__.py'), 
     452        'current-loc': loc('cad_watcher.py'), 
    455453        'editor-state-list': [(loc('activitylog_watcher.py'), 
    456454                               {'attrib-starts': [('readFile|0|', 
     
    467465                              (loc('cad_watcher.py'), 
    468466                               {'attrib-starts': [('getLogEntries|0|', 
    469         24)], 
    470                                 'code-line': '            print pathToLog + '\ 
    471         '" missing: assuming reset."\n', 
    472                                 'first-line': 45L, 
     467        18)], 
     468                                'code-line': '            return []\n', 
     469                                'first-line': 33L, 
    473470                                'folded-linenos': [], 
    474                                 'sel-line': 37L, 
    475                                 'sel-line-start': 1087L, 
    476                                 'selection_end': 1143L, 
    477                                 'selection_start': 1143L, 
     471                                'sel-line': 45L, 
     472                                'sel-line-start': 1479L, 
     473                                'selection_end': 1479L, 
     474                                'selection_start': 1479L, 
    478475                                'zoom': 0L}), 
    479476                              (loc('cms_watcher.py'), 
     
    531528         loc('__main__.py')]), 
    532529                               'open_files': [u'../../../config/logging_service.cfg', 
    533         u'cad_watcher.py', 
    534         u'cms_watcher.py', 
    535530        u'activitylog_watcher.py', 
    536531        u'logging_service.py', 
    537         u'__main__.py']}, 
     532        u'__main__.py', 
     533        u'cms_watcher.py', 
     534        u'cad_watcher.py']}, 
    538535        'saved_notebook_display': None, 
    539536        'split_percents': {0: 0.5}, 
     
    556553                         1197, 
    557554                         722)}]} 
    558 guimgr.recent-documents = [loc('__main__.py'), 
     555guimgr.recent-documents = [loc('cad_watcher.py'), 
     556                           loc('cms_watcher.py'), 
     557                           loc('__main__.py'), 
    559558                           loc('logging_service.py'), 
    560559                           loc('activitylog_watcher.py'), 
    561                            loc('../../../config/logging_service.cfg'), 
    562                            loc('cad_watcher.py'), 
    563                            loc('cms_watcher.py')] 
     560                           loc('../../../config/logging_service.cfg')] 
    564561guimgr.visual-state = {loc('get_app_properties.py'): {'attrib-starts': [], 
    565562        'code-line': '', 
Note: See TracChangeset for help on using the changeset viewer.