-
Notifications
You must be signed in to change notification settings - Fork 0
Sourcery refactored master branch #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,10 +22,6 @@ def portfolio_cost(filename): | |
| return total_cost | ||
|
|
||
| import sys | ||
| if len(sys.argv) == 2: | ||
| filename = sys.argv[1] | ||
| else: | ||
| filename = input('Enter a filename:') | ||
|
|
||
| filename = sys.argv[1] if len(sys.argv) == 2 else input('Enter a filename:') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines
|
||
| cost = portfolio_cost(filename) | ||
| print('Total cost:', cost) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| # bounce.py | ||
|
|
||
| height = 100 | ||
| bounce = 1 | ||
| while bounce <= 10: | ||
| for bounce in range(1, 11): | ||
| height = height * (3/5) | ||
| print(bounce, round(height, 4)) | ||
| bounce += 1 | ||
|
Comment on lines
-4
to
-8
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,10 +23,6 @@ def portfolio_cost(filename): | |
| return total_cost | ||
|
|
||
| import sys | ||
| if len(sys.argv) == 2: | ||
| filename = sys.argv[1] | ||
| else: | ||
| filename = input('Enter a filename:') | ||
|
|
||
| filename = sys.argv[1] if len(sys.argv) == 2 else input('Enter a filename:') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines
|
||
| cost = portfolio_cost(filename) | ||
| print('Total cost:', cost) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,10 +39,7 @@ def parse_csv(filename, select=None, types=None, has_headers=True, delimiter=',' | |
| continue | ||
|
|
||
| # Make a dictionary or a tuple | ||
| if headers: | ||
| record = dict(zip(headers, row)) | ||
| else: | ||
| record = tuple(row) | ||
| record = dict(zip(headers, row)) if headers else tuple(row) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| records.append(record) | ||
|
|
||
| return records | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,10 +39,7 @@ def parse_csv(filename, select=None, types=None, has_headers=True, delimiter=',' | |
| continue | ||
|
|
||
| # Make a dictionary or a tuple | ||
| if headers: | ||
| record = dict(zip(headers, row)) | ||
| else: | ||
| record = tuple(row) | ||
| record = dict(zip(headers, row)) if headers else tuple(row) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| records.append(record) | ||
|
|
||
| return records | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,13 +7,9 @@ def portfolio_cost(filename): | |
| Computes the total cost (shares*price) of a portfolio file | ||
| ''' | ||
| portfolio = report.read_portfolio(filename) | ||
| return sum([s['shares']*s['price'] for s in portfolio]) | ||
| return sum(s['shares']*s['price'] for s in portfolio) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| import sys | ||
| if len(sys.argv) == 2: | ||
| filename = sys.argv[1] | ||
| else: | ||
| filename = input('Enter a filename:') | ||
|
|
||
| filename = sys.argv[1] if len(sys.argv) == 2 else input('Enter a filename:') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines
|
||
| cost = portfolio_cost(filename) | ||
| print('Total cost:', cost) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,10 +39,7 @@ def parse_csv(filename, select=None, types=None, has_headers=True, delimiter=',' | |
| continue | ||
|
|
||
| # Make a dictionary or a tuple | ||
| if headers: | ||
| record = dict(zip(headers, row)) | ||
| else: | ||
| record = tuple(row) | ||
| record = dict(zip(headers, row)) if headers else tuple(row) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| records.append(record) | ||
|
|
||
| return records | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,11 +7,11 @@ def portfolio_cost(filename): | |
| Computes the total cost (shares*price) of a portfolio file | ||
| ''' | ||
| portfolio = report.read_portfolio(filename) | ||
| return sum([s['shares'] * s['price'] for s in portfolio]) | ||
| return sum(s['shares'] * s['price'] for s in portfolio) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| def main(args): | ||
| if len(args) != 2: | ||
| raise SystemExit('Usage: %s portfoliofile' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfoliofile') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| filename = args[1] | ||
| print('Total cost:', portfolio_cost(filename)) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,7 +54,7 @@ def portfolio_report(portfoliofile, pricefile): | |
|
|
||
| def main(args): | ||
| if len(args) != 3: | ||
| raise SystemExit('Usage: %s portfile pricefile' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfile pricefile') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| portfolio_report(args[1], args[2]) | ||
|
|
||
| if __name__ == '__main__': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,10 +38,7 @@ def parse_csv(lines, select=None, types=None, has_headers=True, delimiter=',', s | |
| continue | ||
|
|
||
| # Make a dictionary or a tuple | ||
| if headers: | ||
| record = dict(zip(headers, row)) | ||
| else: | ||
| record = tuple(row) | ||
| record = dict(zip(headers, row)) if headers else tuple(row) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| records.append(record) | ||
|
|
||
| return records | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,11 +7,11 @@ def portfolio_cost(filename): | |
| Computes the total cost (shares*price) of a portfolio file | ||
| ''' | ||
| portfolio = report.read_portfolio(filename) | ||
| return sum([s['shares'] * s['price'] for s in portfolio]) | ||
| return sum(s['shares'] * s['price'] for s in portfolio) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| def main(args): | ||
| if len(args) != 2: | ||
| raise SystemExit('Usage: %s portfoliofile' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfoliofile') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| filename = args[1] | ||
| print('Total cost:', portfolio_cost(filename)) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,7 +56,7 @@ def portfolio_report(portfoliofile, pricefile): | |
|
|
||
| def main(args): | ||
| if len(args) != 3: | ||
| raise SystemExit('Usage: %s portfile pricefile' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfile pricefile') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| portfolio_report(args[1], args[2]) | ||
|
|
||
| if __name__ == '__main__': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,10 +30,7 @@ def parse_csv(filename, select=None, types=None, has_headers=True, delimiter=',' | |
| row = [func(val) for func, val in zip(types, row)] | ||
|
|
||
| # Make a dictionary or a tuple | ||
| if headers: | ||
| record = dict(zip(headers, row)) | ||
| else: | ||
| record = tuple(row) | ||
| record = dict(zip(headers, row)) if headers else tuple(row) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| records.append(record) | ||
|
|
||
| return records | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,10 +38,7 @@ def parse_csv(lines, select=None, types=None, has_headers=True, delimiter=',', s | |
| continue | ||
|
|
||
| # Make a dictionary or a tuple | ||
| if headers: | ||
| record = dict(zip(headers, row)) | ||
| else: | ||
| record = tuple(row) | ||
| record = dict(zip(headers, row)) if headers else tuple(row) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| records.append(record) | ||
|
|
||
| return records | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,11 +7,11 @@ def portfolio_cost(filename): | |
| Computes the total cost (shares*price) of a portfolio file | ||
| ''' | ||
| portfolio = report.read_portfolio(filename) | ||
| return sum([s.cost() for s in portfolio]) | ||
| return sum(s.cost() for s in portfolio) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| def main(args): | ||
| if len(args) != 2: | ||
| raise SystemExit('Usage: %s portfoliofile' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfoliofile') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| filename = args[1] | ||
| print('Total cost:', portfolio_cost(filename)) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,8 +14,7 @@ def read_portfolio(filename): | |
| select=['name','shares','price'], | ||
| types=[str,int,float]) | ||
|
|
||
| portfolio = [ Stock(d['name'], d['shares'], d['price']) for d in portdicts ] | ||
| return portfolio | ||
| return [ Stock(d['name'], d['shares'], d['price']) for d in portdicts ] | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| def read_prices(filename): | ||
| ''' | ||
|
|
@@ -63,7 +62,7 @@ def portfolio_report(portfoliofile, pricefile, fmt='txt'): | |
|
|
||
| def main(args): | ||
| if len(args) != 4: | ||
| raise SystemExit('Usage: %s portfile pricefile format' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfile pricefile format') | ||
|
Comment on lines
-66
to
+65
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| portfolio_report(args[1], args[2], args[3]) | ||
|
|
||
| if __name__ == '__main__': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,10 +38,7 @@ def parse_csv(lines, select=None, types=None, has_headers=True, delimiter=',', s | |
| continue | ||
|
|
||
| # Make a dictionary or a tuple | ||
| if headers: | ||
| record = dict(zip(headers, row)) | ||
| else: | ||
| record = tuple(row) | ||
| record = dict(zip(headers, row)) if headers else tuple(row) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| records.append(record) | ||
|
|
||
| return records | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,11 +7,11 @@ def portfolio_cost(filename): | |
| Computes the total cost (shares*price) of a portfolio file | ||
| ''' | ||
| portfolio = report.read_portfolio(filename) | ||
| return sum([s.cost() for s in portfolio]) | ||
| return sum(s.cost() for s in portfolio) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| def main(args): | ||
| if len(args) != 2: | ||
| raise SystemExit('Usage: %s portfoliofile' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfoliofile') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| filename = args[1] | ||
| print('Total cost:', portfolio_cost(filename)) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,8 +13,7 @@ def read_portfolio(filename): | |
| select=['name','shares','price'], | ||
| types=[str,int,float]) | ||
|
|
||
| portfolio = [ Stock(d['name'], d['shares'], d['price']) for d in portdicts ] | ||
| return portfolio | ||
| return [ Stock(d['name'], d['shares'], d['price']) for d in portdicts ] | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| def read_prices(filename): | ||
| ''' | ||
|
|
@@ -62,7 +61,7 @@ def portfolio_report(portfoliofile, pricefile): | |
|
|
||
| def main(args): | ||
| if len(args) != 3: | ||
| raise SystemExit('Usage: %s portfile pricefile' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfile pricefile') | ||
|
Comment on lines
-65
to
+64
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| portfolio_report(args[1], args[2]) | ||
|
|
||
| if __name__ == '__main__': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,10 +38,7 @@ def parse_csv(lines, select=None, types=None, has_headers=True, delimiter=',', s | |
| continue | ||
|
|
||
| # Make a dictionary or a tuple | ||
| if headers: | ||
| record = dict(zip(headers, row)) | ||
| else: | ||
| record = tuple(row) | ||
| record = dict(zip(headers, row)) if headers else tuple(row) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| records.append(record) | ||
|
|
||
| return records | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,11 +7,11 @@ def portfolio_cost(filename): | |
| Computes the total cost (shares*price) of a portfolio file | ||
| ''' | ||
| portfolio = report.read_portfolio(filename) | ||
| return sum([s.cost() for s in portfolio]) | ||
| return sum(s.cost() for s in portfolio) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| def main(args): | ||
| if len(args) != 2: | ||
| raise SystemExit('Usage: %s portfoliofile' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfoliofile') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| filename = args[1] | ||
| print('Total cost:', portfolio_cost(filename)) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,8 +14,7 @@ def read_portfolio(filename): | |
| select=['name','shares','price'], | ||
| types=[str,int,float]) | ||
|
|
||
| portfolio = [ Stock(d['name'], d['shares'], d['price']) for d in portdicts ] | ||
| return portfolio | ||
| return [ Stock(d['name'], d['shares'], d['price']) for d in portdicts ] | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| def read_prices(filename): | ||
| ''' | ||
|
|
@@ -63,7 +62,7 @@ def portfolio_report(portfoliofile, pricefile, fmt='txt'): | |
|
|
||
| def main(args): | ||
| if len(args) != 4: | ||
| raise SystemExit('Usage: %s portfile pricefile format' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfile pricefile format') | ||
|
Comment on lines
-66
to
+65
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| portfolio_report(args[1], args[2], args[3]) | ||
|
|
||
| if __name__ == '__main__': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,10 +38,7 @@ def parse_csv(lines, select=None, types=None, has_headers=True, delimiter=',', s | |
| continue | ||
|
|
||
| # Make a dictionary or a tuple | ||
| if headers: | ||
| record = dict(zip(headers, row)) | ||
| else: | ||
| record = tuple(row) | ||
| record = dict(zip(headers, row)) if headers else tuple(row) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| records.append(record) | ||
|
|
||
| return records | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ def portfolio_cost(filename): | |
|
|
||
| def main(args): | ||
| if len(args) != 2: | ||
| raise SystemExit('Usage: %s portfoliofile' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfoliofile') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| filename = args[1] | ||
| print('Total cost:', portfolio_cost(filename)) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,11 +14,11 @@ def __getitem__(self, index): | |
| return self._holdings[index] | ||
|
|
||
| def __contains__(self, name): | ||
| return any([s.name == name for s in self._holdings]) | ||
| return any(s.name == name for s in self._holdings) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| @property | ||
| def total_cost(self): | ||
| return sum([s.shares * s.price for s in self._holdings]) | ||
| return sum(s.shares * s.price for s in self._holdings) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| def tabulate_shares(self): | ||
| from collections import Counter | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,7 +64,7 @@ def portfolio_report(portfoliofile, pricefile, fmt='txt'): | |
|
|
||
| def main(args): | ||
| if len(args) != 4: | ||
| raise SystemExit('Usage: %s portfile pricefile format' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfile pricefile format') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| portfolio_report(args[1], args[2], args[3]) | ||
|
|
||
| if __name__ == '__main__': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,7 @@ def ticker(portfile, logfile, fmt): | |
|
|
||
| def main(args): | ||
| if len(args) != 4: | ||
| raise SystemExit('Usage: %s portfoliofile logfile fmt' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfoliofile logfile fmt') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| ticker(args[1], args[2], args[3]) | ||
|
|
||
| if __name__ == '__main__': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,10 +38,7 @@ def parse_csv(lines, select=None, types=None, has_headers=True, delimiter=',', s | |
| continue | ||
|
|
||
| # Make a dictionary or a tuple | ||
| if headers: | ||
| record = dict(zip(headers, row)) | ||
| else: | ||
| record = tuple(row) | ||
| record = dict(zip(headers, row)) if headers else tuple(row) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| records.append(record) | ||
|
|
||
| return records | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ def portfolio_cost(filename): | |
|
|
||
| def main(args): | ||
| if len(args) != 2: | ||
| raise SystemExit('Usage: %s portfoliofile' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfoliofile') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| filename = args[1] | ||
| print('Total cost:', portfolio_cost(filename)) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,7 +64,7 @@ def portfolio_report(portfoliofile, pricefile, fmt='txt'): | |
|
|
||
| def main(args): | ||
| if len(args) != 4: | ||
| raise SystemExit('Usage: %s portfile pricefile format' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfile pricefile format') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| portfolio_report(args[1], args[2], args[3]) | ||
|
|
||
| if __name__ == '__main__': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ def ticker(portfile, logfile, fmt): | |
|
|
||
| def main(args): | ||
| if len(args) != 4: | ||
| raise SystemExit('Usage: %s portfoliofile logfile fmt' % args[0]) | ||
| raise SystemExit(f'Usage: {args[0]} portfoliofile logfile fmt') | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| ticker(args[1], args[2], args[3]) | ||
|
|
||
| if __name__ == '__main__': | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines
19-23refactored with the following changes:aug-assign)