epogrebnyak / abacus

A small yet valid double-entry accounting system in Python and command line.
https://epogrebnyak.github.io/abacus/
GNU General Public License v3.0
59 stars 4 forks source link

add .print() and .rich_print(width=80) methods to reports #48

Closed epogrebnyak closed 1 year ago

epogrebnyak commented 1 year ago

Should encapsulate the following:

income_statement = book.income_statement()
balance_sheet = book.balance_sheet()
tv = PlainTextViewer(rename_dict=chart.names)
tv.print(balance_sheet)
tv.print(income_statement)

rv = RichViewer(rename_dict=chart.names, width=80)
rv.print(balance_sheet)
rv.print(income_statement)

Resuting code:

income_statement.print()
income_statement.rich_print(width=85)
balance_sheet.print()
balance_sheet.rich_print()