00001
00002
00003
00004
00005 import sys
00006 import os
00007 import Configuration.PyReleaseValidation
00008 from Configuration.PyReleaseValidation.ConfigBuilder import ConfigBuilder, defaultOptions
00009 from Configuration.PyReleaseValidation.cmsDriverOptions import options, python_config_filename
00010
00011
00012 configBuilder = ConfigBuilder(options)
00013 configBuilder.prepare()
00014
00015
00016 if options.python_filename: python_config_filename = options.python_filename
00017 config = file(python_config_filename,"w")
00018 config.write(configBuilder.pythonCfgCode)
00019 config.close()
00020
00021
00022 if options.dump_python:
00023 result = {}
00024 execfile(python_config_filename, result)
00025 process = result["process"]
00026 expanded = process.dumpPython()
00027 expandedFile = file(python_config_filename,"w")
00028 expandedFile.write(expanded)
00029 expandedFile.close()
00030 print "Expanded config file", python_config_filename, "created"
00031 sys.exit(0)
00032
00033 if options.no_exec_flag:
00034 print "Config file "+python_config_filename+ " created"
00035 sys.exit(0)
00036 else:
00037 commandString = options.prefix+" cmsRun"
00038 print "Starting "+commandString+' '+python_config_filename
00039 commands = commandString.lstrip().split()
00040 os.execvpe(commands[0],commands+[python_config_filename],os.environ)
00041 sys.exit()
00042
00043
00044
00045