The AccountingFormatter class has good overarching methods for printing the results of a query to the flux-accounting database, but there is some functionality specific to viewing bank information from the database that could use its own subclass.
This PR adds a new subclass called BankFormatter, which contains unique methods for viewing bank/user information in hierarchical and parsable formats with the view-bank command, particularly with the --tree, --users, and -P options. A new --fields option is also added to match the customization available in the list-banks command. It removes the helper functions previously defined in bank_subcommands.py in favor of using this new subclass.
I've added some new unit tests for the output of the reworked view-bank command to the testsuite as well as adjusted a number of expected output files throughout the testsuite to account for the use of the new BankFormatter subclass.
Problem
The
AccountingFormatter
class has good overarching methods for printing the results of a query to the flux-accounting database, but there is some functionality specific to viewing bank information from the database that could use its own subclass.This PR adds a new subclass called
BankFormatter
, which contains unique methods for viewing bank/user information in hierarchical and parsable formats with theview-bank
command, particularly with the--tree
,--users
, and-P
options. A new--fields
option is also added to match the customization available in thelist-banks
command. It removes the helper functions previously defined inbank_subcommands.py
in favor of using this new subclass.I've added some new unit tests for the output of the reworked
view-bank
command to the testsuite as well as adjusted a number of expected output files throughout the testsuite to account for the use of the newBankFormatter
subclass.