diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-11 16:03:50 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-11 17:02:25 -0400 |
commit | dea2aed0b509734ec4e1cd163ac2a4f013000da2 (patch) | |
tree | 7908da76c67ae5172882306a319bf26df81b73b4 /src/py_journal.cc | |
parent | d580079df892c30d023b3211d6c4611c17b11f8f (diff) | |
download | fork-ledger-dea2aed0b509734ec4e1cd163ac2a4f013000da2.tar.gz fork-ledger-dea2aed0b509734ec4e1cd163ac2a4f013000da2.tar.bz2 fork-ledger-dea2aed0b509734ec4e1cd163ac2a4f013000da2.zip |
Untabified all source files
Diffstat (limited to 'src/py_journal.cc')
-rw-r--r-- | src/py_journal.cc | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/src/py_journal.cc b/src/py_journal.cc index cd25d134..fc4f671b 100644 --- a/src/py_journal.cc +++ b/src/py_journal.cc @@ -126,7 +126,7 @@ namespace { } account_t * py_find_account_2(journal_t& journal, const string& name, - const bool auto_create) + const bool auto_create) { return journal.find_account(name, auto_create); } @@ -138,14 +138,14 @@ namespace { struct collector_wrapper { - journal_t& journal; + journal_t& journal; report_t report; collect_posts * posts_collector; post_handler_ptr chain; collector_wrapper(journal_t& _journal, report_t& base) : journal(_journal), report(base), - posts_collector(new collect_posts) {} + posts_collector(new collect_posts) {} ~collector_wrapper() { journal.clear_xdata(); } @@ -167,31 +167,31 @@ namespace { { if (journal.has_xdata()) { PyErr_SetString(PyExc_RuntimeError, - _("Cannot have multiple journal collections open at once")); + _("Cannot have multiple journal collections open at once")); throw_error_already_set(); } report_t& current_report(downcast<report_t>(*scope_t::default_scope)); shared_ptr<collector_wrapper> coll(new collector_wrapper(journal, - current_report)); + current_report)); std::auto_ptr<journal_t> save_journal (current_report.session.journal.release()); current_report.session.journal.reset(&journal); try { strings_list remaining = - process_arguments(split_arguments(query.c_str()), coll->report); + process_arguments(split_arguments(query.c_str()), coll->report); coll->report.normalize_options("register"); value_t args; foreach (const string& arg, remaining) - args.push_back(string_value(arg)); + args.push_back(string_value(arg)); coll->report.parse_query_args(args, "@Journal.collect"); journal_posts_iterator walker(coll->journal); coll->chain = - chain_post_handlers(post_handler_ptr(coll->posts_collector), - coll->report); + chain_post_handlers(post_handler_ptr(coll->posts_collector), + coll->report); pass_down_posts(coll->chain, walker); } catch (...) { @@ -227,36 +227,36 @@ void export_journal() shared_ptr<collect_posts>, boost::noncopyable >("PostCollector") .def("__len__", &collect_posts::length) .def("__iter__", python::range<return_internal_reference<1, - with_custodian_and_ward_postcall<1, 0> > > - (&collect_posts::begin, &collect_posts::end)) + with_custodian_and_ward_postcall<1, 0> > > + (&collect_posts::begin, &collect_posts::end)) ; class_< collector_wrapper, shared_ptr<collector_wrapper>, boost::noncopyable >("PostCollectorWrapper", no_init) .def("__len__", &collector_wrapper::length) .def("__getitem__", posts_getitem, return_internal_reference<1, - with_custodian_and_ward_postcall<0, 1> >()) + with_custodian_and_ward_postcall<0, 1> >()) .def("__iter__", - python::range<return_value_policy<reference_existing_object, - with_custodian_and_ward_postcall<0, 1> > > - (&collector_wrapper::begin, &collector_wrapper::end)) + python::range<return_value_policy<reference_existing_object, + with_custodian_and_ward_postcall<0, 1> > > + (&collector_wrapper::begin, &collector_wrapper::end)) ; class_< journal_t::fileinfo_t > ("FileInfo") .def(init<path>()) .add_property("filename", - make_getter(&journal_t::fileinfo_t::filename), - make_setter(&journal_t::fileinfo_t::filename)) + make_getter(&journal_t::fileinfo_t::filename), + make_setter(&journal_t::fileinfo_t::filename)) .add_property("size", - make_getter(&journal_t::fileinfo_t::size), - make_setter(&journal_t::fileinfo_t::size)) + make_getter(&journal_t::fileinfo_t::size), + make_setter(&journal_t::fileinfo_t::size)) .add_property("modtime", - make_getter(&journal_t::fileinfo_t::modtime), - make_setter(&journal_t::fileinfo_t::modtime)) + make_getter(&journal_t::fileinfo_t::modtime), + make_setter(&journal_t::fileinfo_t::modtime)) .add_property("from_stream", - make_getter(&journal_t::fileinfo_t::from_stream), - make_setter(&journal_t::fileinfo_t::from_stream)) + make_getter(&journal_t::fileinfo_t::from_stream), + make_setter(&journal_t::fileinfo_t::from_stream)) ; class_< journal_t, boost::noncopyable > ("Journal") @@ -264,28 +264,28 @@ void export_journal() .def(init<string>()) .add_property("master", - make_getter(&journal_t::master, - return_internal_reference<1, - with_custodian_and_ward_postcall<1, 0> >())) + make_getter(&journal_t::master, + return_internal_reference<1, + with_custodian_and_ward_postcall<1, 0> >())) .add_property("bucket", - make_getter(&journal_t::bucket, - return_internal_reference<1, - with_custodian_and_ward_postcall<1, 0> >()), - make_setter(&journal_t::bucket)) + make_getter(&journal_t::bucket, + return_internal_reference<1, + with_custodian_and_ward_postcall<1, 0> >()), + make_setter(&journal_t::bucket)) .add_property("was_loaded", make_getter(&journal_t::was_loaded)) .def("add_account", &journal_t::add_account) .def("remove_account", &journal_t::remove_account) .def("find_account", py_find_account_1, - return_internal_reference<1, - with_custodian_and_ward_postcall<0, 1> >()) + return_internal_reference<1, + with_custodian_and_ward_postcall<0, 1> >()) .def("find_account", py_find_account_2, - return_internal_reference<1, - with_custodian_and_ward_postcall<0, 1> >()) + return_internal_reference<1, + with_custodian_and_ward_postcall<0, 1> >()) .def("find_account_re", &journal_t::find_account_re, - return_internal_reference<1, - with_custodian_and_ward_postcall<0, 1> >()) + return_internal_reference<1, + with_custodian_and_ward_postcall<0, 1> >()) .def("add_xact", &journal_t::add_xact) .def("remove_xact", &journal_t::remove_xact) @@ -293,20 +293,20 @@ void export_journal() .def("__len__", xacts_len) #if 0 .def("__getitem__", xacts_getitem, - return_internal_reference<1, - with_custodian_and_ward_postcall<0, 1> >()) + return_internal_reference<1, + with_custodian_and_ward_postcall<0, 1> >()) #endif .def("__iter__", python::range<return_internal_reference<> > - (&journal_t::xacts_begin, &journal_t::xacts_end)) + (&journal_t::xacts_begin, &journal_t::xacts_end)) .def("xacts", python::range<return_internal_reference<> > - (&journal_t::xacts_begin, &journal_t::xacts_end)) + (&journal_t::xacts_begin, &journal_t::xacts_end)) .def("auto_xacts", python::range<return_internal_reference<> > - (&journal_t::auto_xacts_begin, &journal_t::auto_xacts_end)) + (&journal_t::auto_xacts_begin, &journal_t::auto_xacts_end)) .def("period_xacts", python::range<return_internal_reference<> > - (&journal_t::period_xacts_begin, &journal_t::period_xacts_end)) + (&journal_t::period_xacts_begin, &journal_t::period_xacts_end)) .def("sources", python::range<return_internal_reference<> > - (&journal_t::sources_begin, &journal_t::sources_end)) + (&journal_t::sources_begin, &journal_t::sources_end)) .def("read", py_read) |