8 using namespace boost::python;
13 std::string initCommand(
"from FWCore.ParameterSet.Types import makeCppPSet\n"
15 initCommand += fileName +
"')";
17 handle<>(PyRun_String(initCommand.c_str(),
20 mainNamespace.ptr()));
21 std::string
command(
"makeCppPSet(locals(), topPSet)");
22 handle<>(PyRun_String(command.c_str(),
25 mainNamespace.ptr()));
32 command +=
"\nfrom FWCore.ParameterSet.Types import makeCppPSet\nmakeCppPSet(locals(), topPSet)";
33 handle<>(PyRun_String(command.c_str(),
36 mainNamespace.ptr()));
41 boost::shared_ptr<ParameterSet>
47 boost::shared_ptr<ParameterSet>
55 boost::shared_ptr<ParameterSet>&
main) {
60 boost::shared_ptr<ParameterSet>
68 mainNamespace[
"topPSet"] = ptr(&theProcessPSet);
72 if(module.substr(module.size()-3) ==
".py") {
78 catch( error_already_set ) {
82 boost::shared_ptr<ParameterSet> returnValue(
new ParameterSet);
83 theProcessPSet.
pset().
swap(*returnValue);
void pythonToCppException(const std::string &iType)
static void makePSetsFromString(std::string const &module, boost::python::object &mainNamespace)
int main(int argc, char **argv)
void swap(ParameterSet &other)
boost::shared_ptr< edm::ParameterSet > parameterSet()
boost::shared_ptr< ParameterSet > readConfig(std::string const &config)
boost::shared_ptr< ParameterSet > readPSetsFrom(std::string const &fileOrString)
edm::ParameterSet & pset()
void makeParameterSets(std::string const &configtext, boost::shared_ptr< ParameterSet > &main)
essentially the same as the previous method
static void makePSetsFromFile(std::string const &fileName, boost::python::object &mainNamespace)