Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 from threading import Thread
00008
00009 class forkit(Thread):
00010 def __init__(self):
00011 Thread.__init__(self)
00012 def run(self):
00013 import sys
00014 import os
00015 import Configuration.PyReleaseValidation
00016 from Configuration.PyReleaseValidation.ConfigBuilder import ConfigBuilder, defaultOptions
00017 from Configuration.PyReleaseValidation.cmsDriverOptions import options, python_config_filename
00018
00019
00020 configBuilder = ConfigBuilder(options, with_output = True, with_input = True)
00021 configBuilder.prepare()
00022
00023
00024 if options.python_filename: python_config_filename = options.python_filename
00025 config = file(python_config_filename,"w")
00026 config.write(configBuilder.pythonCfgCode)
00027 config.close()
00028
00029
00030 if options.dump_python:
00031 result = {}
00032 execfile(python_config_filename, result)
00033 process = result["process"]
00034 expanded = process.dumpPython()
00035 expandedFile = file(python_config_filename,"w")
00036 expandedFile.write(expanded)
00037 expandedFile.close()
00038 print "Expanded config file", python_config_filename, "created"
00039 sys.exit(0)
00040
00041 if options.no_exec_flag:
00042 print "Config file "+python_config_filename+ " created"
00043 sys.exit(0)
00044 else:
00045 commandString = options.prefix+" cmsRun"
00046 print "Starting "+commandString+' '+python_config_filename
00047 commands = commandString.lstrip().split()
00048 os.execvpe(commands[0],commands+[python_config_filename],os.environ)
00049 sys.exit()
00050
00051 import os
00052 current = forkit()
00053 current.start()
00054
00055
00056
00057