#include <FWCore/ParameterSet/interface/PythonParseTree.h>
Public Member Functions | |
boost::python::list | children (const std::string &dotDelimitedNode) const |
names of the nodes below this one. Includes are transparent | |
void | dump (const std::string &dotDelimitedNode) const |
std::string | dumpTree () const |
dump the tree to a string, to be written to a file. | |
boost::python::list | modules () const |
the names of all modules in this parse tree | |
boost::python::list | modulesOfType (const std::string &type) const |
names of all modules of type, e.g., service or es_source | |
boost::python::list | outputModules () const |
void | process () |
processes all includes, renames, etc. | |
PythonParseTree (const std::string &filename) | |
void | replaceValue (const std::string &dotDelimitedNode, const std::string &value) |
replaces the value of an entry | |
void | replaceValues (const std::string &dotDelimitedNode, boost::python::list &values) |
WARNING the input list gets destroyed by pop()s. | |
std::string | typeOf (const std::string &dotDelimitedNode) const |
std::string | value (const std::string &dotDelimitedNode) const |
only works for EntryNodes inside modules. Hope to include top-level PSets soon | |
boost::python::list | values (const std::string &dotDelimitedNode) const |
only works for VEntryNodes | |
Static Public Member Functions | |
static void | exceptionTranslator (const edm::Exception &e) |
changes edm::Exceptions to python exceptions | |
Private Attributes | |
edm::pset::ParseTree | theTree |
Definition at line 9 of file PythonParseTree.h.
PythonParseTree::PythonParseTree | ( | const std::string & | filename | ) |
Definition at line 7 of file PythonParseTree.cc.
References edm::pset::ParseTree::process(), and theTree.
00008 : theTree(edm::read_whole_file(filename)) 00009 { 00010 00011 theTree.process(); 00012 }
boost::python::list PythonParseTree::children | ( | const std::string & | dotDelimitedNode | ) | const |
names of the nodes below this one. Includes are transparent
Definition at line 73 of file PythonParseTree.cc.
References edm::pset::ParseTree::children(), and theTree.
Referenced by BOOST_PYTHON_MODULE().
void PythonParseTree::dump | ( | const std::string & | dotDelimitedNode | ) | const |
Definition at line 49 of file PythonParseTree.cc.
References edm::pset::ParseTree::print(), and theTree.
Referenced by BOOST_PYTHON_MODULE().
std::string PythonParseTree::dumpTree | ( | ) | const |
dump the tree to a string, to be written to a file.
Definition at line 79 of file PythonParseTree.cc.
References edm::pset::Node::COMPRESSED, theTree, and edm::pset::ParseTree::top().
Referenced by BOOST_PYTHON_MODULE().
00080 { 00081 std::ostringstream ost; 00082 theTree.top()->print(ost, edm::pset::Node::COMPRESSED); 00083 return ost.str(); 00084 }
void PythonParseTree::exceptionTranslator | ( | const edm::Exception & | e | ) | [static] |
changes edm::Exceptions to python exceptions
Definition at line 87 of file PythonParseTree.cc.
References cms::Exception::what().
Referenced by BOOST_PYTHON_MODULE().
00088 { 00089 PyErr_SetString(PyExc_RuntimeError, e.what()); 00090 }
boost::python::list PythonParseTree::modules | ( | ) | const |
the names of all modules in this parse tree
Definition at line 16 of file PythonParseTree.cc.
References edm::pset::ParseTree::modules(), and theTree.
Referenced by BOOST_PYTHON_MODULE().
boost::python::list PythonParseTree::modulesOfType | ( | const std::string & | type | ) | const |
names of all modules of type, e.g., service or es_source
Definition at line 23 of file PythonParseTree.cc.
References edm::pset::ParseTree::modulesOfType(), and theTree.
Referenced by BOOST_PYTHON_MODULE().
00024 { 00025 return edm::toPythonList<std::string>(theTree.modulesOfType(type)); 00026 }
boost::python::list PythonParseTree::outputModules | ( | ) | const |
void PythonParseTree::process | ( | ) |
processes all includes, renames, etc.
Definition at line 29 of file PythonParseTree.cc.
References edm::pset::ParseTree::process(), and theTree.
Referenced by BOOST_PYTHON_MODULE().
void PythonParseTree::replaceValue | ( | const std::string & | dotDelimitedNode, | |
const std::string & | value | |||
) |
replaces the value of an entry
Definition at line 35 of file PythonParseTree.cc.
References edm::pset::ParseTree::replace(), and theTree.
Referenced by BOOST_PYTHON_MODULE().
void PythonParseTree::replaceValues | ( | const std::string & | dotDelimitedNode, | |
boost::python::list & | values | |||
) |
WARNING the input list gets destroyed by pop()s.
Definition at line 42 of file PythonParseTree.cc.
References edm::pset::ParseTree::replace(), and theTree.
Referenced by BOOST_PYTHON_MODULE().
std::string PythonParseTree::typeOf | ( | const std::string & | dotDelimitedNode | ) | const |
Definition at line 55 of file PythonParseTree.cc.
References theTree, and edm::pset::ParseTree::typeOf().
Referenced by BOOST_PYTHON_MODULE().
std::string PythonParseTree::value | ( | const std::string & | dotDelimitedNode | ) | const |
only works for EntryNodes inside modules. Hope to include top-level PSets soon
Definition at line 61 of file PythonParseTree.cc.
References theTree, and edm::pset::ParseTree::value().
Referenced by BOOST_PYTHON_MODULE().
boost::python::list PythonParseTree::values | ( | const std::string & | dotDelimitedNode | ) | const |
only works for VEntryNodes
Definition at line 67 of file PythonParseTree.cc.
References theTree, and edm::pset::ParseTree::values().
Referenced by BOOST_PYTHON_MODULE().
edm::pset::ParseTree PythonParseTree::theTree [private] |
Definition at line 54 of file PythonParseTree.h.
Referenced by children(), dump(), dumpTree(), modules(), modulesOfType(), process(), PythonParseTree(), replaceValue(), replaceValues(), typeOf(), value(), and values().