summaryrefslogtreecommitdiff
path: root/src/py_account.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/py_account.cc')
-rw-r--r--src/py_account.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/py_account.cc b/src/py_account.cc
index d1d35cda..056cd722 100644
--- a/src/py_account.cc
+++ b/src/py_account.cc
@@ -32,6 +32,7 @@
#include <system.hh>
#include "pyinterp.h"
+#include "pyutils.h"
#include "account.h"
#include "post.h"
@@ -90,6 +91,10 @@ namespace {
return account.xdata();
}
+ PyObject * py_account_unicode(account_t& account) {
+ return str_to_py_unicode(account.fullname());
+ }
+
} // unnamed namespace
void export_account()
@@ -180,7 +185,8 @@ void export_account()
.def_readwrite("note", &account_t::note)
.def_readonly("depth", &account_t::depth)
- .def(self_ns::str(self))
+ .def("__str__", &account_t::fullname)
+ .def("__unicode__", py_account_unicode)
.def("fullname", &account_t::fullname)
.def("partial_name", &account_t::partial_name)