summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/py_account.cc10
-rw-r--r--src/py_commodity.cc9
-rw-r--r--src/py_item.cc15
-rw-r--r--src/py_post.cc5
-rw-r--r--src/py_utils.cc15
5 files changed, 32 insertions, 22 deletions
diff --git a/src/py_account.cc b/src/py_account.cc
index b0d0a843..8310f5ec 100644
--- a/src/py_account.cc
+++ b/src/py_account.cc
@@ -142,9 +142,10 @@ void export_account()
class_< account_t::xdata_t > ("AccountXData")
#if 1
- .def("flags", &supports_flags<uint_least16_t>::flags)
+ .add_property("flags",
+ &supports_flags<uint_least16_t>::flags,
+ &supports_flags<uint_least16_t>::set_flags)
.def("has_flags", &supports_flags<uint_least16_t>::has_flags)
- .def("set_flags", &supports_flags<uint_least16_t>::set_flags)
.def("clear_flags", &supports_flags<uint_least16_t>::clear_flags)
.def("add_flags", &supports_flags<uint_least16_t>::add_flags)
.def("drop_flags", &supports_flags<uint_least16_t>::drop_flags)
@@ -162,9 +163,10 @@ void export_account()
class_< account_t > ("Account")
#if 1
- .def("flags", &supports_flags<>::flags)
+ .add_property("flags",
+ &supports_flags<>::flags,
+ &supports_flags<>::set_flags)
.def("has_flags", &supports_flags<>::has_flags)
- .def("set_flags", &supports_flags<>::set_flags)
.def("clear_flags", &supports_flags<>::clear_flags)
.def("add_flags", &supports_flags<>::add_flags)
.def("drop_flags", &supports_flags<>::drop_flags)
diff --git a/src/py_commodity.cc b/src/py_commodity.cc
index 7cd84f1c..c20053ad 100644
--- a/src/py_commodity.cc
+++ b/src/py_commodity.cc
@@ -189,9 +189,10 @@ void export_commodity()
class_< commodity_t, boost::noncopyable > ("Commodity", no_init)
#if 1
- .def("flags", &delegates_flags<uint_least16_t>::flags)
+ .add_property("flags",
+ &supports_flags<uint_least16_t>::flags,
+ &supports_flags<uint_least16_t>::set_flags)
.def("has_flags", &delegates_flags<uint_least16_t>::has_flags)
- .def("set_flags", &delegates_flags<uint_least16_t>::set_flags)
.def("clear_flags", &delegates_flags<uint_least16_t>::clear_flags)
.def("add_flags", &delegates_flags<uint_least16_t>::add_flags)
.def("drop_flags", &delegates_flags<uint_least16_t>::drop_flags)
@@ -248,9 +249,9 @@ void export_commodity()
class_< annotation_t > ("Annotation", no_init)
#if 1
- .def("flags", &supports_flags<>::flags)
+ .add_property("flags", &supports_flags<>::flags,
+ &supports_flags<>::set_flags)
.def("has_flags", &supports_flags<>::has_flags)
- .def("set_flags", &supports_flags<>::set_flags)
.def("clear_flags", &supports_flags<>::clear_flags)
.def("add_flags", &supports_flags<>::add_flags)
.def("drop_flags", &supports_flags<>::drop_flags)
diff --git a/src/py_item.cc b/src/py_item.cc
index ac544c6a..8a6e495a 100644
--- a/src/py_item.cc
+++ b/src/py_item.cc
@@ -109,9 +109,9 @@ void export_item()
class_< item_t > ("JournalItem", init<uint_least8_t>())
#endif
#if 1
- .def("flags", &supports_flags<>::flags)
+ .add_property("flags", &supports_flags<>::flags,
+ &supports_flags<>::set_flags)
.def("has_flags", &supports_flags<>::has_flags)
- .def("set_flags", &supports_flags<>::set_flags)
.def("clear_flags", &supports_flags<>::clear_flags)
.def("add_flags", &supports_flags<>::add_flags)
.def("drop_flags", &supports_flags<>::drop_flags)
@@ -138,6 +138,9 @@ void export_item()
.def("get_tag", py_get_tag_1s)
.def("get_tag", py_get_tag_1m)
.def("get_tag", py_get_tag_2m)
+ .def("tag", py_get_tag_1s)
+ .def("tag", py_get_tag_1m)
+ .def("tag", py_get_tag_2m)
.def("set_tag", &item_t::set_tag)
@@ -148,11 +151,11 @@ void export_item()
make_getter(&item_t::use_effective_date),
make_setter(&item_t::use_effective_date))
- .def("date", &item_t::date)
- .def("effective_date", &item_t::effective_date)
+ .add_property("date", &item_t::date, make_setter(&item_t::_date))
+ .add_property("effective_date", &item_t::effective_date,
+ make_setter(&item_t::_date_eff))
- .def("set_state", &item_t::set_state)
- .def("state", &item_t::state)
+ .add_property("state", &item_t::state, &item_t::set_state)
.def("lookup", &item_t::lookup)
diff --git a/src/py_post.cc b/src/py_post.cc
index 9f7476d1..64bdde83 100644
--- a/src/py_post.cc
+++ b/src/py_post.cc
@@ -87,9 +87,10 @@ void export_post()
class_< post_t::xdata_t > ("PostingXData")
#if 1
- .def("flags", &supports_flags<uint_least16_t>::flags)
+ .add_property("flags",
+ &supports_flags<uint_least16_t>::flags,
+ &supports_flags<uint_least16_t>::set_flags)
.def("has_flags", &supports_flags<uint_least16_t>::has_flags)
- .def("set_flags", &supports_flags<uint_least16_t>::set_flags)
.def("clear_flags", &supports_flags<uint_least16_t>::clear_flags)
.def("add_flags", &supports_flags<uint_least16_t>::add_flags)
.def("drop_flags", &supports_flags<uint_least16_t>::drop_flags)
diff --git a/src/py_utils.cc b/src/py_utils.cc
index c2177c20..b2b9d0f8 100644
--- a/src/py_utils.cc
+++ b/src/py_utils.cc
@@ -172,9 +172,10 @@ void export_utils()
.def(init<supports_flags<uint_least8_t> >())
.def(init<uint_least8_t>())
- .def("flags", &supports_flags<uint_least8_t>::flags)
+ .add_property("flags",
+ &supports_flags<uint_least8_t>::flags,
+ &supports_flags<uint_least8_t>::set_flags)
.def("has_flags", &supports_flags<uint_least8_t>::has_flags)
- .def("set_flags", &supports_flags<uint_least8_t>::set_flags)
.def("clear_flags", &supports_flags<uint_least8_t>::clear_flags)
.def("add_flags", &supports_flags<uint_least8_t>::add_flags)
.def("drop_flags", &supports_flags<uint_least8_t>::drop_flags)
@@ -184,9 +185,10 @@ void export_utils()
.def(init<supports_flags<uint_least16_t> >())
.def(init<uint_least16_t>())
- .def("flags", &supports_flags<uint_least16_t>::flags)
+ .add_property("flags",
+ &supports_flags<uint_least16_t>::flags,
+ &supports_flags<uint_least16_t>::set_flags)
.def("has_flags", &supports_flags<uint_least16_t>::has_flags)
- .def("set_flags", &supports_flags<uint_least16_t>::set_flags)
.def("clear_flags", &supports_flags<uint_least16_t>::clear_flags)
.def("add_flags", &supports_flags<uint_least16_t>::add_flags)
.def("drop_flags", &supports_flags<uint_least16_t>::drop_flags)
@@ -204,9 +206,10 @@ void export_utils()
class_< delegates_flags<uint_least16_t>,
boost::noncopyable > ("DelegatesFlags16", no_init)
- .def("flags", &delegates_flags<uint_least16_t>::flags)
+ .add_property("flags",
+ &delegates_flags<uint_least16_t>::flags,
+ &delegates_flags<uint_least16_t>::set_flags)
.def("has_flags", &delegates_flags<uint_least16_t>::has_flags)
- .def("set_flags", &delegates_flags<uint_least16_t>::set_flags)
.def("clear_flags", &delegates_flags<uint_least16_t>::clear_flags)
.def("add_flags", &delegates_flags<uint_least16_t>::add_flags)
.def("drop_flags", &delegates_flags<uint_least16_t>::drop_flags)