fixed an obscure "print" bug
This commit is contained in:
parent
c5d519447e
commit
2f16a82132
2 changed files with 18 additions and 14 deletions
19
format.cc
19
format.cc
|
|
@ -324,24 +324,22 @@ void format_t::format(std::ostream& out, const details_t& details) const
|
||||||
disp = stream.str();
|
disp = stream.str();
|
||||||
use_disp = true;
|
use_disp = true;
|
||||||
} else {
|
} else {
|
||||||
unsigned int xacts_real_count = 0;
|
unsigned int xacts_count = 0;
|
||||||
transaction_t * first = NULL;
|
transaction_t * first = NULL;
|
||||||
transaction_t * last = NULL;
|
transaction_t * last = NULL;
|
||||||
|
|
||||||
for (transactions_list::const_iterator i
|
for (transactions_list::const_iterator i
|
||||||
= details.entry->transactions.begin();
|
= details.entry->transactions.begin();
|
||||||
i != details.entry->transactions.end();
|
i != details.entry->transactions.end();
|
||||||
i++)
|
i++) {
|
||||||
if (! ((*i)->flags & TRANSACTION_AUTO)) {
|
xacts_count++;
|
||||||
xacts_real_count++;
|
|
||||||
|
|
||||||
if (! first)
|
if (! first)
|
||||||
first = *i;
|
first = *i;
|
||||||
last = *i;
|
last = *i;
|
||||||
}
|
}
|
||||||
|
|
||||||
use_disp = (xacts_real_count == 2 &&
|
use_disp = (xacts_count == 2 && details.xact == last &&
|
||||||
details.xact == last &&
|
|
||||||
first->amount == - last->amount);
|
first->amount == - last->amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -558,7 +556,6 @@ void export_format()
|
||||||
#if 0
|
#if 0
|
||||||
def("partial_account_name", partial_account_name);
|
def("partial_account_name", partial_account_name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
def("display_account", display_account);
|
def("display_account", display_account);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
13
main.py
13
main.py
|
|
@ -262,11 +262,18 @@ if config.predicate:
|
||||||
# simple walk in C++, using `walk_entries'.
|
# simple walk in C++, using `walk_entries'.
|
||||||
|
|
||||||
if 1:
|
if 1:
|
||||||
walk_entries (journal, handler)
|
if command == "e":
|
||||||
|
walk_transactions (new_entry, handler)
|
||||||
|
else:
|
||||||
|
walk_entries (journal, handler)
|
||||||
else:
|
else:
|
||||||
for entry in journal:
|
if command == "e":
|
||||||
for xact in entry:
|
for xact in new_entry:
|
||||||
handler (xact)
|
handler (xact)
|
||||||
|
else:
|
||||||
|
for entry in journal:
|
||||||
|
for xact in entry:
|
||||||
|
handler (xact)
|
||||||
|
|
||||||
# Flush the handlers, causing them to output whatever data is still
|
# Flush the handlers, causing them to output whatever data is still
|
||||||
# pending.
|
# pending.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue