swapnilsparsh / CricketScoreViewer

Cricket Score Viewer (Ipl)
MIT License
2 stars 8 forks source link

Fix result_score IndexError (issue #2) #3

Closed IanFindlay closed 3 years ago

IanFindlay commented 3 years ago

The result_score parse was looking for a class that no longer exists (issue #2) so I updated it to the current one. Similarly, the index of the scores themselves appeared to be wrong, so I've updated them.

To prevent IndexErrors breaking the program in the future, I've wrapped each of the parsing statements in try/except blocks.

Hopefully this is useful.

IanFindlay commented 3 years ago

The site has updated and now there is a live result score that can be used. I'm going to make it so it attempts to get a live result_score then, if there is no live game so no live message, attempts to get a finished result_score. Finally, if there is neither then it will catch the IndexError exceptions so it doesn't break.

Closing this PR until I make these changes.

IanFindlay commented 3 years ago

Hopefully, re-opening this pull request will add the latest changes mentioned above to it. If not, I'll make another.

IanFindlay commented 3 years ago

Conflict here due to the recent merge. Do you want me to maintain the new formatting that was done @swapnilsparsh ? I have never seen variables aligned like that in Python code and I am fairly sure it isn't PEP 8 compliant.

Decided to resolve the conflict and remove the odd formatting.

IanFindlay commented 3 years ago

Sorry about that, accidentally deleted that section when I was resolving the conflict. It should work now, but I can't test it as the game is currently finished. At the very least, it is back to how it was with only the IndexError related code changed.

swapnilsparsh commented 3 years ago

Sorry about that, accidentally deleted that section when I was resolving the conflict. It should work now, but I can't test it as the game is currently finished. At the very least, it is back to how it was with only the IndexError related code changed.

If the game is over then also it should show the score of the finished game.

IanFindlay commented 3 years ago

If the game is over then also it should show the score of the finished game.

It does, but I can't test the refresh function on a game that is finished as there is nothing to be updated.

swapnilsparsh commented 3 years ago

If the game is over then also it should show the score of the finished game.

It does, but I can't test the refresh function on a game that is finished as there is nothing to be updated.

In order to merge your PR , I would like to do a small change here that you can change the lines of codes once again so that when I run the program it automatically fetch the current on going match score or the last active match score without pressing the refresh button

IanFindlay commented 3 years ago

it automatically fetch the current on going match score or the last active match score without pressing the refresh button

Does it not already do this for you? When I run this on my local machine the latest match, whether it's finished or currently live, is displayed without having to press refresh.

swapnilsparsh commented 3 years ago

Thank you for Solving the Issue. @IanFindlay 👍🏼