CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
cmsDriver.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 # A Pyrelval Wrapper
4 
5 import sys
6 import os
7 import Configuration.PyReleaseValidation
8 from Configuration.PyReleaseValidation.ConfigBuilder import ConfigBuilder, defaultOptions
9 from Configuration.PyReleaseValidation.cmsDriverOptions import options, python_config_filename
10 
11 # after cleanup of all config parameters pass it to the ConfigBuilder
12 configBuilder = ConfigBuilder(options, with_output = True, with_input = True)
13 configBuilder.prepare()
14 
15 # fetch the results and write it to file
16 if options.python_filename: python_config_filename = options.python_filename
17 config = file(python_config_filename,"w")
18 config.write(configBuilder.pythonCfgCode)
19 config.close()
20 
21 # handle different dump options
22 if options.dump_python:
23  result = {}
24  execfile(python_config_filename, result)
25  process = result["process"]
26  expanded = process.dumpPython()
27  expandedFile = file(python_config_filename,"w")
28  expandedFile.write(expanded)
29  expandedFile.close()
30  print "Expanded config file", python_config_filename, "created"
31  sys.exit(0)
32 
33 if options.no_exec_flag:
34  print "Config file "+python_config_filename+ " created"
35  sys.exit(0)
36 else:
37  commandString = options.prefix+" cmsRun"
38  print "Starting "+commandString+' '+python_config_filename
39  commands = commandString.lstrip().split()
40  os.execvpe(commands[0],commands+[python_config_filename],os.environ)
41  sys.exit()
42 
43 
44 
45 
list file
Definition: dbtoweb.py:253
double split
Definition: MVATrainer.cc:139