2019-09-04 14:42:52 +02:00
|
|
|
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
|
|
|
|
#include <pybind11/stl.h>
|
|
|
|
|
|
2019-09-13 09:40:13 +02:00
|
|
|
#include "export.hpp"
|
2019-09-04 14:42:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
void (ParseContext::*ctx_update)(const std::string&, InputError::Action) = &ParseContext::update;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-13 09:22:49 +02:00
|
|
|
void python::common::export_ParseContext(py::module& module) {
|
2019-09-04 14:42:52 +02:00
|
|
|
|
|
|
|
|
py::class_< ParseContext >(module, "ParseContext" )
|
|
|
|
|
.def(py::init<>())
|
|
|
|
|
.def(py::init<const std::vector<std::pair<std::string, InputError::Action>>>())
|
|
|
|
|
.def( "update", ctx_update );
|
|
|
|
|
|
|
|
|
|
py::enum_< InputError::Action >( module, "action" )
|
|
|
|
|
.value( "throw", InputError::Action::THROW_EXCEPTION )
|
|
|
|
|
.value( "warn", InputError::Action::WARN )
|
|
|
|
|
.value( "ignore", InputError::Action::IGNORE );
|
|
|
|
|
|
|
|
|
|
}
|