30 #ifndef _MIRA_TOOLBOXES_PYTHON_PYTHONCHECK_H_ 31 #define _MIRA_TOOLBOXES_PYTHON_PYTHONCHECK_H_ 42 namespace mira {
namespace python {
70 void extract(T& var,
const boost::python::dict& d,
const std::string& key)
73 var = boost::python::extract<T>(d[key]);
90 if(!err.
type.empty()) os <<
"Error of type " << err.
type;
95 if(!err.
msg.empty()) os <<
"\nErrorMsg: " << err.
msg;
std::string type
Definition: PythonCheck.h:84
Definition: PythonCheck.h:46
std::string description
Definition: PythonCheck.h:78
std::ostream & operator<<(std::ostream &os, const PythonError &err)
Definition: PythonCheck.h:87
bool isError()
Definition: PythonCheck.h:65
PythonError(const boost::python::dict &d)
Definition: PythonCheck.h:51
int offset
Definition: PythonCheck.h:82
std::string offsetstr
Definition: PythonCheck.h:83
std::string badline
Definition: PythonCheck.h:77
PythonError()
Definition: PythonCheck.h:49
Exception handling for python exceptions.
int lineno
Definition: PythonCheck.h:80
std::string msg
Definition: PythonCheck.h:81
PythonError checkSyntax(const std::string &code)
check syntax of python string
Include this instead of boost/python.hpp to reduce compile time warning spam from Boost internal inco...
void extract(T &var, const boost::python::dict &d, const std::string &key)
Definition: PythonCheck.h:70
std::string filename
Definition: PythonCheck.h:79