(portfile, logfile, fmt)
| 25 | return rows |
| 26 | |
| 27 | def ticker(portfile, logfile, fmt): |
| 28 | portfolio = report.read_portfolio(portfile) |
| 29 | lines = follow(logfile) |
| 30 | rows = parse_stock_data(lines) |
| 31 | rows = (row for row in rows if row['name'] in portfolio) |
| 32 | formatter = tableformat.create_formatter(fmt) |
| 33 | formatter.headings(['Name','Price','Change']) |
| 34 | for row in rows: |
| 35 | formatter.row([ row['name'], f"{row['price']:0.2f}", f"{row['change']:0.2f}"] ) |
| 36 | |
| 37 | def main(args): |
| 38 | if len(args) != 4: |
no test coverage detected