From 63d94e8f241ea00abae2b34c826b7a5152cf1b32 Mon Sep 17 00:00:00 2001 From: jacobdenobel Date: Wed, 8 Nov 2023 15:20:30 +0100 Subject: [PATCH] interface --- ioh/src/logger.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ioh/src/logger.cpp b/ioh/src/logger.cpp index 5eefb977..d275a918 100644 --- a/ioh/src/logger.cpp +++ b/ioh/src/logger.cpp @@ -169,19 +169,21 @@ void define_writers(py::module &mod) { py::module m = mod.def_submodule("writer"); py::class_>(m, "Writer") - .def("open", py::arg("path"), &Writer::open) + .def("open", &Writer::open, py::arg("path")) .def("close", &Writer::close) .def("is_open", &Writer::is_open) .def("write", &Writer::write, py::arg("data")) ; py::class_>(m, "OFStream").def(py::init<>()); - py::class_>(m, "FWriter").def( + py::class_>(m, "FWriter").def( py::init(), py::arg("buffer_size") = 0, - py:arg("buffer_mode") = _IOFBF + py::arg("buffer_mode") = _IOFBF ); - py::class_>(m, "CachedFWriter").def(py::init<>()); + py::class_>(m, "CachedFWriter") + .def(py::init<>()) + ; } @@ -607,6 +609,7 @@ void define_logger(py::module &m) { py::class_(m, "Path").def(py::init()); py::implicitly_convertible(); + define_writers(m); define_triggers(m); define_properties(m);