9 using namespace boost::python;
31 PySys_SetArgv(argc, argv);
39 theMainModule =
object(handle<>(borrowed(PyImport_AddModule(const_cast<char*>(
"__main__")))));
49 if(config.substr(config.size()-3) ==
".py") {
55 catch(error_already_set) {
62 std::string initCommand(
"import FWCore.ParameterSet.Config as cms\n"
64 initCommand += fileName +
"')";
66 handle<>(PyRun_String(initCommand.c_str(),
71 handle<>(PyRun_String(command.c_str(),
79 command +=
"\nprocess.fillProcessDesc(processPSet)";
80 handle<>(PyRun_String(command.c_str(),
92 std::ostringstream os;
boost::python::object theMainModule
PythonParameterSet theProcessPSet
void pythonToCppException(const std::string &iType)
void readFile(std::string const &fileName)
boost::shared_ptr< edm::ParameterSet > parameterSet()
void read(std::string const &config)
boost::python::object theMainNamespace
edm::ParameterSet & pset()
boost::shared_ptr< edm::ProcessDesc > processDesc()
void readString(std::string const &pyConfig)