diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-20 23:23:44 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-20 23:23:44 -0500 |
commit | d5e957204c2799f07f9ecf868d2d846bea5682ef (patch) | |
tree | e2618ed53b09e0ea7d0d5871c237ec3b5127faae /src/py_account.cc | |
parent | bd455c98743ce354b875d67a1d607a682d604fe0 (diff) | |
download | fork-ledger-d5e957204c2799f07f9ecf868d2d846bea5682ef.tar.gz fork-ledger-d5e957204c2799f07f9ecf868d2d846bea5682ef.tar.bz2 fork-ledger-d5e957204c2799f07f9ecf868d2d846bea5682ef.zip |
Fixed Ledger/Python byte vs. char Unicode bridge
Diffstat (limited to 'src/py_account.cc')
-rw-r--r-- | src/py_account.cc | 8 |
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) |