Commit 5d01e8de authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #14124. Should accept bool arg.

The property with value PropertyWithValue<OptionalBool> should take a boolean as an argument when scripted from python. It's just going to be more convenient for users.
parent d2c472ec
......@@ -48,14 +48,18 @@ void export_PropertyWithValueOptionalBool() {
private:
OptionalBool fromPyObj(const boost::python::object &value) const {
OptionalBool target;
extract<OptionalBool> asDirect(value);
extract<OptionalBool::Value> asEnum(value);
const extract<OptionalBool> asDirect(value);
const extract<OptionalBool::Value> asEnum(value);
const extract<bool> asBool(value);
if (asDirect.check()) {
target = asDirect();
} else if (asEnum.check()) {
target = OptionalBool(asEnum());
} else {
} else if (asBool.check()) {
target = OptionalBool(asBool());
}
else {
throw std::invalid_argument("Unknown conversion to OptionalBool");
}
return target;
......@@ -97,7 +101,4 @@ void export_PropertyWithValueOptionalBool() {
};
Registry::TypeRegistry::subscribe<OptionalBoolPropertyValueHandler>();
// Registry::TypeRegistry::subscribe<Registry::TypedPropertyValueHandler<OptionalBool>
// >();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment