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