3#include <boost/python.hpp>
13"Initialise from opal file\n"
14"- file_name: string corresponding to the file name of the OPAL\n"
16"Note that if file_name is not valid, OPAL may terminate the python script\n"
17"execution abnormally (without the usual python exit semantics).\n"
19"Returns an integer; 0 for successful execution or non-zero if an error\n"
23 std::string exe(
"parser");
26 argvr[0] = exe.data();
27 argvr[1] = file_name.data();
34"List the objects that are known by the Opal parser, either through calls to\n"
35"initialise_from_opal_file or through calls directly to the python API\n"
37"Returns a list of strings, each one corresponding to the name of a\n"
42 boost::python::list pynames;
43 for (
size_t i = 0; i < names.size(); ++i) {
44 pynames.append(names[i]);
51"The parser module is used to load an OPAL input file from within python";
56 boost::python::def(
"initialise_from_opal_file",
58 boost::python::args(
"file_name"),
61 boost::python::def(
"list_objects",
int opalMain(int argc, char *argv[])
void registerExceptions()
std::string initialise_from_opal_file_docstring
int initialise_from_opal_file(std::string file_name)
std::string list_objects_docstring
BOOST_PYTHON_MODULE(parser)
std::string module_docstring
boost::python::list list_objects()
std::vector< std::string > getAllNames() const
Get a list of all objects.
static OpalData * getInstance()