ultimatepp/bazaar/CoreBoostPy/CoreBoostPy.cpp
kohait 1b334d9d1d bazaar: BoostPyTest: convenience restructure, prepare compile MSC10
git-svn-id: svn://ultimatepp.org/upp/trunk@4099 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-10-24 19:41:16 +00:00

43 lines
708 B
C++

#include "CoreBoostPy.h"
using namespace boost::python;
NAMESPACE_UPP
Value PyEvalConvert::Format(const Value& q) const
{
Value v;
try
{
object arg(q);
locals["arg"] = arg;
object o = eval(expr.Begin(), locals, globals);
v = extract<Value>(o);
}
catch(boost::python::error_already_set const &)
{
// Parse and output the exception
std::string perror_str = parse_py_exception();
String es = perror_str;
v = ErrorValue(es);
}
return v;
}
void export_Core()
{
ONCELOCK
{
export_Callback();
export_Gate();
export_GTypes();
export_String();
export_Value();
export_ValueArray();
export_ValueMap();
export_Log();
}
}
END_UPP_NAMESPACE