13 std::string initCommand(
"from FWCore.ParameterSet.Types import makeCppPSet\n" 15 initCommand += fileName +
"')";
17 handle<>(PyRun_String(initCommand.c_str(),
20 mainNamespace.ptr()));
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()));
40 namespace boost_python {
42 std::unique_ptr<edm::ParameterSet>
48 std::unique_ptr<edm::ParameterSet>
56 std::unique_ptr<edm::ParameterSet>&
main) {
61 std::unique_ptr<edm::ParameterSet>
69 mainNamespace[
"topPSet"] = ptr(&theProcessPSet);
73 if(module.substr(module.size()-3) ==
".py") {
79 catch( error_already_set
const& ) {
83 return std::make_unique<edm::ParameterSet>(
ParameterSet(theProcessPSet.
pset()));
std::unique_ptr< edm::ParameterSet > parameterSet() const
static void makePSetsFromString(std::string const &module, boost::python::object &mainNamespace)
void pythonToCppException(const std::string &iType)
std::unique_ptr< edm::ParameterSet > readConfig(std::string const &config, int argc, char *argv[])
same, but with arguments
std::unique_ptr< edm::ParameterSet > readPSetsFrom(std::string const &fileOrString)
edm::ParameterSet & pset()
void makeParameterSets(std::string const &configtext, std::unique_ptr< ParameterSet > &main)
essentially the same as the previous method
static void makePSetsFromFile(std::string const &fileName, boost::python::object &mainNamespace)