X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fpython%2Fsigrok%2Fcore%2Fclasses.i;h=69c05a30b808317aa0f11b849c0fbb94bbff9f81;hb=8686b747cd40695c36f998603f6e853ee5eea883;hp=01201bd3d7e9ae5a63f2369595eb79c334f1d0f0;hpb=ae2cdde4d20e600480ae2cb86b7488fa13400812;p=libsigrok.git diff --git a/bindings/python/sigrok/core/classes.i b/bindings/python/sigrok/core/classes.i index 01201bd3..69c05a30 100644 --- a/bindings/python/sigrok/core/classes.i +++ b/bindings/python/sigrok/core/classes.i @@ -45,6 +45,8 @@ which provides access to the error code and description." %module(docstring=DOCSTRING) classes %{ +#include "config.h" + #include #include #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION @@ -53,8 +55,6 @@ which provides access to the error code and description." PyObject *PyGObject_lib; PyObject *GLib; -#include "config.h" - #if PYGOBJECT_FLAGS_SIGNED typedef gint pyg_flags_type; #else @@ -426,6 +426,16 @@ std::map dict_to_map_options(PyObject *dict, return (long) $self; } + std::string __str__() + { + return $self->name(); + } + + std::string __repr__() + { + return "Class." + $self->name(); + } + %pythoncode { def __eq__(self, other):