pykms: add Videomode.__repr__
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 24 Jan 2017 12:10:20 +0000 (14:10 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 24 Jan 2017 12:10:20 +0000 (14:10 +0200)
py/pykms/pykmsbase.cpp

index 5247158d7bd4d794733b28136024dca6aa665610..13c4dd1a170c56eb87ac7b0e4db2ad2f7369e341 100644 (file)
@@ -144,6 +144,8 @@ void init_pykmsbase(py::module &m)
 
                        .def_readwrite("flags", &Videomode::flags)
                        .def_readwrite("type", &Videomode::type)
 
                        .def_readwrite("flags", &Videomode::flags)
                        .def_readwrite("type", &Videomode::type)
+
+                       .def("__repr__", [](const Videomode& vm) { return "<pykms.Videomode " + to_string(vm.hdisplay) + "x" + to_string(vm.vdisplay) + ">"; })
                        ;
 
        py::class_<AtomicReq>(m, "AtomicReq")
                        ;
 
        py::class_<AtomicReq>(m, "AtomicReq")