rerun += 1 if conf.has_key('path') and (not os.environ.get('PATH') or os.environ['PATH'] != conf['path']): os.environ['PATH'] = conf['path'] rerun += 1 if rerun > 0 and os.environ.has_key('EDC_RUN_MULTI') == False: os.environ['EDC_RUN_MULTI'] = "True" runpy = "%s/bin/run.py" % os.environ['EDC_HOME'] os.execvpe(runpy, sys.argv, os.environ) if sys.version_info < (2, 7): print "ERROR : You must use a Python superior or equal to 2.7" else: try: from edc_lib import motor if len(sys.argv) > 2: """ We have more than one argument """ result = motor.start_car(sys.argv[1], sys.argv[2:]) elif len(sys.argv) == 2: """ We have one argument => source """ result = motor.start_car(sys.argv[1]) elif len(sys.argv) == 1: """ We have no argument, we return the list of available sources """ result = motor.start_car() except Exception: print Exception print "ERROR : I could not execute the program properly" # End start.py
from edc_lib import key if len(sys.argv) > 1 and sys.argv[1]: list_src = key.getAllMotorsToStart(sys.argv[1]) if list_src: from edc_lib import motor result = False for src in list_src: for key, args in src.iteritems(): if key != 'general': try: print '##################################' print "%s %s" % (key, ' '.join(args['args'])) print '##################################' if key and len(args['args']): """ We have more than one argument """ result = motor.start_car ( key, args['args'] ) elif key: """ We have one argument => source """ result = motor.start_car( key ) except Exception as e: print "ERROR : %s could not be executed" % (key) else: list_available_sources = key.allMethodsMulti() else: list_available_sources = key.allMethodsMulti() except Exception as e: print e print "ERROR : I could not execute the program properly"
rerun += 1 if conf.has_key('path') and (not os.environ.get('PATH') or os.environ['PATH'] != conf['path']): os.environ['PATH'] = conf['path'] rerun += 1 if rerun > 0 and os.environ.has_key('EDC_RUN_MULTI') == False: os.environ['EDC_RUN_MULTI'] = "True" runpy = "%s/bin/run.py" % os.environ['EDC_HOME'] os.execvpe(runpy, sys.argv, os.environ) if sys.version_info < (2, 7): print "ERROR : You must use a Python superior or equal to 2.7" else: try: from edc_lib import motor if len ( sys.argv ) > 2: """ We have more than one argument """ result = motor.start_car ( sys.argv[1], sys.argv[2:]) elif len( sys.argv ) == 2: """ We have one argument => source """ result = motor.start_car( sys.argv[1] ) elif len( sys.argv ) == 1 : """ We have no argument, we return the list of available sources """ result = motor.start_car() except Exception: print Exception print "ERROR : I could not execute the program properly" # End start.py
from edc_lib import key if len(sys.argv) > 1 and sys.argv[1]: list_src = key.getAllMotorsToStart(sys.argv[1]) if list_src: from edc_lib import motor result = False for src in list_src: for key, args in src.iteritems(): if key != 'general': try: print '##################################' print "%s %s" % (key, ' '.join(args['args'])) print '##################################' if key and len(args['args']): """ We have more than one argument """ result = motor.start_car(key, args['args']) elif key: """ We have one argument => source """ result = motor.start_car(key) except Exception as e: print "ERROR : %s could not be executed" % ( key) else: list_available_sources = key.allMethodsMulti() else: list_available_sources = key.allMethodsMulti() except Exception as e: print e print "ERROR : I could not execute the program properly"
not os.environ.get('PYTHONPATH') or os.environ['PYTHONPATH'] != conf['pythonpath']): os.environ['PYTHONPATH'] = conf['pythonpath'] rerun += 1 if conf.has_key('path') and (not os.environ.get('PATH') or os.environ['PATH'] != conf['path']): os.environ['PATH'] = conf['path'] rerun += 1 if rerun > 0 and os.environ.has_key('EDC_RUN_MULTI') == False: os.environ['EDC_RUN_MULTI'] = "True" runpy = "%s/bin/run_list.py" % os.environ['EDC_HOME'] os.execvpe(runpy, sys.argv, os.environ) if sys.version_info < (2, 7): print "ERROR : You must use a Python superior or equal to 2.7" else: try: from edc_lib import motor if sys.argv and len(sys.argv) >= 2: result = motor.start_car(search=sys.argv[1]) else: result = motor.start_car() except Exception: print Exception print "ERROR : I could not execute the program properly" # End start.py