summaryrefslogtreecommitdiff
path: root/src/py_item.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-03 08:50:41 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-03 08:50:41 -0500
commit3d3d21150e8e7f34dede814bdbe71bf019791436 (patch)
tree29e94c54a9b4e7c4605d332166c43bb00917fc0a /src/py_item.cc
parentf86394d969d9495f08433e741c0857f6f5fdd772 (diff)
downloadfork-ledger-3d3d21150e8e7f34dede814bdbe71bf019791436.tar.gz
fork-ledger-3d3d21150e8e7f34dede814bdbe71bf019791436.tar.bz2
fork-ledger-3d3d21150e8e7f34dede814bdbe71bf019791436.zip
Added Python interface for an item_t enum
Diffstat (limited to 'src/py_item.cc')
-rw-r--r--src/py_item.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/py_item.cc b/src/py_item.cc
index 91f7b8ac..ac544c6a 100644
--- a/src/py_item.cc
+++ b/src/py_item.cc
@@ -32,6 +32,7 @@
#include <system.hh>
#include "pyinterp.h"
+#include "scope.h"
#include "mask.h"
#include "item.h"
@@ -96,7 +97,17 @@ void export_item()
scope().attr("ITEM_GENERATED") = ITEM_GENERATED;
scope().attr("ITEM_TEMP") = ITEM_TEMP;
+ enum_< item_t::state_t > ("State")
+ .value("Uncleared", item_t::UNCLEARED)
+ .value("Cleared", item_t::CLEARED)
+ .value("Pending", item_t::PENDING)
+ ;
+
+#if 0
+ class_< item_t, bases<scope_t> > ("JournalItem", init<uint_least8_t>())
+#else
class_< item_t > ("JournalItem", init<uint_least8_t>())
+#endif
#if 1
.def("flags", &supports_flags<>::flags)
.def("has_flags", &supports_flags<>::has_flags)