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


Ignore:
Timestamp:
07/15/2019 02:49:33 PM (7 years ago)
Author:
jdalbey
Message:

Change unifiedlogger to get revision number from a config file instead of application.properties in tmcsim.

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

Legend:

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

    r444 r446  
    1 import logging_service, os, get_app_properties 
     1import logging_service, os, ConfigParser 
    22# This main module is provided so the application can be conveniently bundled for deployment 
    33def main(): 
    4     revNum = get_app_properties.getRevision() 
     4    # get revision number from configuration 
     5    config = ConfigParser.ConfigParser() 
     6    config.read('config/application_properties.cfg') 
     7    revNum = config.get('Versions', 'revision_number') 
     8     
    59    print "Unified Logging Service v"+revNum,"starting from ",os.getcwd() 
    610    logging_service.startup() 
  • trunk/src/python/unifiedlogger/wing_project.wpr

    r445 r446  
    183183                       'toolbox-percent': 1.0, 
    184184                       'toolbox-tree-sel': ''})], 
    185         'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('cad_watcher.py'), 
    186         {'attrib-starts': [('setup|0|', 
    187                             31)], 
    188          'code-line': '    return\n', 
    189          'first-line': 15L, 
     185        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('get_revision'), 
     186        {'attrib-starts': [], 
     187         'code-line': 'print readFile()', 
     188         'first-line': 0L, 
    190189         'folded-linenos': [], 
    191          'sel-line': 33L, 
    192          'sel-line-start': 888L, 
    193          'selection_end': 898L, 
    194          'selection_start': 898L, 
     190         'sel-line': 15L, 
     191         'sel-line-start': 412L, 
     192         'selection_end': 418L, 
     193         'selection_start': 418L, 
    195194         'zoom': 0L}, 
    196         1562953860.143117], 
    197         [loc('logging_service.py'), 
    198          {'attrib-starts': [('startup|0|', 
    199                              17)], 
    200           'code-line': '            f = open(logfilepath + outputFilename, "'\ 
    201                        'a")\n', 
    202           'first-line': 6L, 
    203           'folded-linenos': [], 
    204           'sel-line': 63L, 
    205           'sel-line-start': 2214L, 
    206           'selection_end': 2263L, 
    207           'selection_start': 2263L, 
    208           'zoom': 0L}, 
    209          1563130761.348523], 
    210         [loc('cad_watcher.py'), 
    211          {'attrib-starts': [], 
    212           'code-line': '# Read the cad comments log \n', 
    213           'first-line': 15L, 
    214           'folded-linenos': [], 
    215           'sel-line': 19L, 
    216           'sel-line-start': 546L, 
    217           'selection_end': 838L, 
    218           'selection_start': 546L, 
    219           'zoom': 0L}, 
    220          1563130779.821267], 
    221         [loc('unknown:untitled-1.py'), 
    222          {'attrib-starts': [('readFile|0|', 
    223                              3)], 
    224           'code-line': '', 
    225           'first-line': 0L, 
    226           'folded-linenos': [], 
    227           'sel-line': 15L, 
    228           'sel-line-start': 412L, 
    229           'selection_end': 412L, 
    230           'selection_start': 412L, 
    231           'zoom': 0L}, 
    232          1563130943.219386], 
    233         [loc('__main__.py'), 
    234          {'attrib-starts': [('main|0|', 
    235                              2)], 
    236           'code-line': '    print "Unified Logging Service starting from ",o'\ 
    237                        's.getcwd()\n', 
    238           'first-line': 0L, 
    239           'folded-linenos': [], 
    240           'sel-line': 3L, 
    241           'sel-line-start': 132L, 
    242           'selection_end': 183L, 
    243           'selection_start': 183L, 
    244           'zoom': 0L}, 
    245          1563130944.74234], 
    246         [loc('get_revision'), 
    247          {'attrib-starts': [], 
    248           'code-line': 'print readFile()', 
    249           'first-line': 0L, 
    250           'folded-linenos': [], 
    251           'sel-line': 15L, 
    252           'sel-line-start': 412L, 
    253           'selection_end': 418L, 
    254           'selection_start': 418L, 
    255           'zoom': 0L}, 
    256          1563130972.859102], 
     195        1563130972.859102], 
    257196        [loc('logging_service.py'), 
    258197         {'attrib-starts': [], 
     
    422361          'selection_start': 0L, 
    423362          'zoom': 0L}, 
    424          1563131503.437265]], 
     363         1563131503.437265], 
     364        [loc('__main__.py'), 
     365         {'attrib-starts': [('main|0|', 
     366                             2)], 
     367          'code-line': '    print "Unified Logging Service v"+revNum,"starti'\ 
     368                       'ng from ",os.getcwd()\n', 
     369          'first-line': 0L, 
     370          'folded-linenos': [], 
     371          'sel-line': 4L, 
     372          'sel-line-start': 198L, 
     373          'selection_end': 244L, 
     374          'selection_start': 244L, 
     375          'zoom': 0L}, 
     376         1563231920.207662], 
     377        [loc('get_app_properties.py'), 
     378         {'attrib-starts': [('getProperties|0|', 
     379                             3)], 
     380          'code-line': '        print "Error: missing src/tmcsim/application'\ 
     381                       '.properties file."\n', 
     382          'first-line': 0L, 
     383          'folded-linenos': [], 
     384          'sel-line': 8L, 
     385          'sel-line-start': 173L, 
     386          'selection_end': 213L, 
     387          'selection_start': 213L, 
     388          'zoom': 0L}, 
     389         1563232029.32642], 
     390        [loc('logging_service.py'), 
     391         {'attrib-starts': [('startup|0|', 
     392                             17)], 
     393          'code-line': '    # get path to output file from configuration\n', 
     394          'first-line': 9L, 
     395          'folded-linenos': [], 
     396          'sel-line': 18L, 
     397          'sel-line-start': 528L, 
     398          'selection_end': 721L, 
     399          'selection_start': 528L, 
     400          'zoom': 0L}, 
     401         1563232797.935308], 
     402        [loc('__main__.py'), 
     403         {'attrib-starts': [('main|0|', 
     404                             2)], 
     405          'code-line': '    \n', 
     406          'first-line': 0L, 
     407          'folded-linenos': [], 
     408          'sel-line': 7L, 
     409          'sel-line-start': 340L, 
     410          'selection_end': 344L, 
     411          'selection_start': 344L, 
     412          'zoom': 0L}, 
     413         1563232895.220896], 
     414        [loc('get_app_properties.py'), 
     415         {'attrib-starts': [], 
     416          'code-line': '# Obsolete - moved to config file instead.\n', 
     417          'first-line': 0L, 
     418          'folded-linenos': [], 
     419          'sel-line': 0L, 
     420          'sel-line-start': 0L, 
     421          'selection_end': 42L, 
     422          'selection_start': 42L, 
     423          'zoom': 0L}, 
     424         1563232919.766056]], 
    425425        20), 
    426426        'current-loc': loc('__main__.py'), 
     
    449449                              (loc('get_app_properties.py'), 
    450450                               {'attrib-starts': [], 
    451                                 'code-line': '\n', 
     451                                'code-line': '# Obsolete - moved to config f'\ 
     452        'ile instead.\n', 
    452453                                'first-line': 0L, 
    453454                                'folded-linenos': [], 
    454455                                'sel-line': 0L, 
    455456                                'sel-line-start': 0L, 
    456                                 'selection_end': 0L, 
    457                                 'selection_start': 0L, 
     457                                'selection_end': 42L, 
     458                                'selection_start': 42L, 
    458459                                'zoom': 0L}), 
    459460                              (loc('logging_service.py'), 
    460                                {'attrib-starts': [], 
    461                                 'code-line': 'import cms_watcher, cad_watche'\ 
    462         'r, time, json, ConfigParser\n', 
    463                                 'first-line': 0L, 
     461                               {'attrib-starts': [('startup|0|', 
     462        17)], 
     463                                'code-line': '    # get path to output file '\ 
     464        'from configuration\n', 
     465                                'first-line': 9L, 
    464466                                'folded-linenos': [], 
    465                                 'sel-line': 0L, 
    466                                 'sel-line-start': 0L, 
    467                                 'selection_end': 57L, 
    468                                 'selection_start': 57L, 
     467                                'sel-line': 18L, 
     468                                'sel-line-start': 528L, 
     469                                'selection_end': 721L, 
     470                                'selection_start': 528L, 
    469471                                'zoom': 0L}), 
    470472                              (loc('__main__.py'), 
    471473                               {'attrib-starts': [('main|0|', 
    472474        2)], 
    473                                 'code-line': '    print "Unified Logging Ser'\ 
    474         'vice v"+revNum,"starting from ",os.getcwd()\n', 
     475                                'code-line': '    \n', 
    475476                                'first-line': 0L, 
    476477                                'folded-linenos': [], 
    477                                 'sel-line': 4L, 
    478                                 'sel-line-start': 198L, 
    479                                 'selection_end': 244L, 
    480                                 'selection_start': 244L, 
     478                                'sel-line': 7L, 
     479                                'sel-line-start': 340L, 
     480                                'selection_end': 344L, 
     481                                'selection_start': 344L, 
    481482                                'zoom': 0L})], 
    482483        'has-focus': True, 
     
    487488         loc('logging_service.py'), 
    488489         loc('__main__.py')]), 
    489                                'open_files': [u'cms_watcher.py', 
    490         u'cad_watcher.py', 
     490                               'open_files': [u'cad_watcher.py', 
     491        u'cms_watcher.py', 
    491492        u'logging_service.py', 
    492493        u'get_app_properties.py', 
     
    498499        'traversal_pos': ((0, 
    499500                           3), 
    500                           1563131330.846264), 
     501                          1563232857.216172), 
    501502        'user_data': {}}, 
    502503                 'saved_notebook_display': None, 
     
    506507                 'traversal_pos': ((0, 
    507508                                    4), 
    508                                    1563131506.336019), 
     509                                   1563232923.341114), 
    509510                 'user_data': {}}, 
    510511        'window-alloc': (29, 
Note: See TracChangeset for help on using the changeset viewer.