Make a stock report given portfolio and price data files.
(portfoliofile, pricefile, fmt='txt')
| 47 | formatter.row(rowdata) |
| 48 | |
| 49 | def portfolio_report(portfoliofile, pricefile, fmt='txt'): |
| 50 | ''' |
| 51 | Make a stock report given portfolio and price data files. |
| 52 | ''' |
| 53 | # Read data files |
| 54 | portfolio = read_portfolio(portfoliofile) |
| 55 | prices = read_prices(pricefile) |
| 56 | |
| 57 | # Create the report data |
| 58 | report = make_report_data(portfolio, prices) |
| 59 | |
| 60 | # Print it out |
| 61 | formatter = tableformat.create_formatter(fmt) |
| 62 | print_report(report, formatter) |
| 63 | |
| 64 | def main(args): |
| 65 | if len(args) != 4: |
no test coverage detected