Changeset 5b95591


Ignore:
Timestamp:
04/28/12 00:04:23 (3 years ago)
Author:
Martin Kolman <martin.kolman@…>
Branches:
master
Children:
415970e
Parents:
c484fad
git-author:
Martin Kolman <martin.kolman@…> (04/28/12 00:04:23)
git-committer:
Martin Kolman <martin.kolman@…> (04/28/12 00:04:23)
Message:

add reloading support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modrana.py

    r918171b r5b95591  
    2424 
    2525# module folder name 
     26import subprocess 
     27 
    2628modulesFolder = 'modules' 
    2729import sys 
     
    766768if __name__ == "__main__": 
    767769 
    768   print(" == modRana Starting == ") 
    769  
    770   program = ModRana() 
     770  # check if reload has been requested 
     771 
     772  reloadArg = "--reload" 
     773  if len(sys.argv)>=3 and sys.argv[1] == reloadArg: 
     774    # following argument is path to the modRana main class we want to reload to, 
     775    # optionally followed by any argument for the main class 
     776    print(" == modRana Reloading == ") 
     777    reloadPath = sys.argv[2] 
     778    callArgs = [reloadPath] 
     779    callArgs.extend(sys.argv[3:]) 
     780    subprocess.call(callArgs) 
     781 
     782  else: 
     783    print(" == modRana Starting == ") 
     784 
     785    program = ModRana() 
     786 
     787 
Note: See TracChangeset for help on using the changeset viewer.