diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2023-04-12 20:33:40 +0200 |
---|---|---|
committer | Alexis Hildebrandt <afh@surryhill.net> | 2023-04-12 21:53:11 +0200 |
commit | 9244a27f9548a1d39fb01348fde66ff81f5150a4 (patch) | |
tree | 0f9d06a762a9a9939e1f37be60cf2b5e47da7983 /src/py_commodity.cc | |
parent | 5f78556078d2e61d5c0ef44e36d58f3864cd84d1 (diff) | |
download | fork-ledger-9244a27f9548a1d39fb01348fde66ff81f5150a4.tar.gz fork-ledger-9244a27f9548a1d39fb01348fde66ff81f5150a4.tar.bz2 fork-ledger-9244a27f9548a1d39fb01348fde66ff81f5150a4.zip |
Refactor python related types into ledger::python namespace
Diffstat (limited to 'src/py_commodity.cc')
-rw-r--r-- | src/py_commodity.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/py_commodity.cc b/src/py_commodity.cc index 28074b5c..3ae6801f 100644 --- a/src/py_commodity.cc +++ b/src/py_commodity.cc @@ -40,6 +40,7 @@ namespace ledger { using namespace flags; +using namespace python; using namespace boost::python; namespace { @@ -120,8 +121,8 @@ namespace { return (*i).second.get(); } - python::list py_pool_keys(commodity_pool_t& pool) { - python::list keys; + list py_pool_keys(commodity_pool_t& pool) { + list keys; BOOST_REVERSE_FOREACH (const commodity_pool_t::commodities_map::value_type& pair, pool.commodities) { @@ -296,15 +297,15 @@ void export_commodity() .def("has_key", py_pool_contains) .def("__contains__", py_pool_contains) .def("__iter__", - python::range<return_internal_reference<> > + boost::python::range<return_internal_reference<> > (py_pool_commodities_begin, py_pool_commodities_end)) .def("iteritems", - python::range<return_internal_reference<> > + boost::python::range<return_internal_reference<> > (py_pool_commodities_begin, py_pool_commodities_end)) - .def("iterkeys", python::range<>(py_pool_commodities_keys_begin, + .def("iterkeys", boost::python::range<>(py_pool_commodities_keys_begin, py_pool_commodities_keys_end)) .def("itervalues", - python::range<return_internal_reference<> > + boost::python::range<return_internal_reference<> > (py_pool_commodities_values_begin, py_pool_commodities_values_end)) ; |