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