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
Fix london_underground issue #19642
Fix london_underground issue #19642
Conversation
reason = ' *** '.join( | ||
[status['reason'] for status in line['lineStatuses']]) | ||
reason = ' *** '.join([status['disruption']['additionalInfo'] | ||
for status in line['lineStatuses']]) |
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.
continuation line over-indented for visual indent
statuses = [status['statusSeverityDescription'] | ||
for status in line['lineStatuses']] | ||
state = ' + '.join(sorted(set(statuses))) | ||
|
||
if state == 'Good Service': | ||
if state == 'Good Service': # if good status, this is the only status returned |
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.
line too long (88 > 79 characters)
reason = ' *** '.join( | ||
[status['reason'] for status in line['lineStatuses']]) | ||
reason = ' *** '.join([status['disruption']['additionalInfo'] | ||
for status in line['lineStatuses']]) |
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.
continuation line under-indented for visual indent
@@ -127,7 +128,10 @@ def parse_api_response(response): | |||
reason = 'Nothing to report' | |||
else: | |||
reason = ' *** '.join( | |||
[status['reason'] for status in line['lineStatuses']]) | |||
[status['disruption']['additionalInfo'] for status | |||
in line['lineStatuses']] |
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.
continuation line under-indented for visual indent
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.
Can anyone help here? Spent 15 mins trying this
@@ -127,7 +128,10 @@ def parse_api_response(response): | |||
reason = 'Nothing to report' | |||
else: | |||
reason = ' *** '.join( | |||
[status['reason'] for status in line['lineStatuses']]) | |||
[status['disruption']['additionalInfo'] for status |
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.
trailing whitespace
statuses = [status['statusSeverityDescription'] | ||
for status in line['lineStatuses']] | ||
state = ' + '.join(sorted(set(statuses))) | ||
|
||
if state == 'Good Service': | ||
reason = 'Nothing to report' | ||
else: | ||
reason = ' *** '.join( | ||
[status['reason'] for status in line['lineStatuses']]) | ||
reason = " *** ".join( |
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.
The service interface, I/O and data parsing, should be moved to a standalone library published on pypi.
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.
Will do
@MartinHjelmare changes made |
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.
Good!
Thanks! |
* Update london_underground.py * Update test * Update london_underground.py * Update london_underground.py * Update london_underground.py * Fix lint * Use london-tube-status==0.2
* Update london_underground.py * Update test * Update london_underground.py * Update london_underground.py * Update london_underground.py * Fix lint * Use london-tube-status==0.2
Description:
Now using https://pypi.org/project/london-tube-status/
Related issue (if applicable): fixes #19639