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(),
91 std::ostringstream os;
98 return std::make_shared<edm::ProcessDesc>(
parameterSet());
boost::python::object theMainModule
PythonParameterSet theProcessPSet
void pythonToCppException(const std::string &iType)
void readFile(std::string const &fileName)
void read(std::string const &config)
boost::python::object theMainNamespace
std::shared_ptr< edm::ParameterSet > parameterSet() const
edm::ParameterSet & pset()
void readString(std::string const &pyConfig)
std::shared_ptr< edm::ProcessDesc > processDesc() const