Open derek-adair opened 5 years ago
Ok! took a crack at this. I think i did this in a way that will be unobtrusive. PLEASE take a look at my commit, and give me any feedback that you can provide.
Key points:
This is made available under the 2.0.1a3
release in pypi.
OR you can check out dev and build locally
make dev-install
This... doesn't work. It breaks when you pass nflgame.game.Game(
Unsure the best way to do this anymore. Maybe if the extra schedule data isn't included, fetch it?
This would require modifying _search_schedule_by_eid, or something along those lines.
<eid>
) works if the game is in the futureFixed _search_schedule() by eid: It was failing b/c we are in pre-season and the default is REG.
I decided to just return a flat dict of the schedule data when an eid matches to simplify this.
Ruminating on if these changes are worth it.... I may just implement a live-esque script that just searches the schedule by week.
I'm still having issues with this. It seems as though there are two try
/except
blocks to handle an HTTPError
, and the nested block isn't allowing the outer block to properly handle the exception. Everything works perfectly for me when I delete the except urllib.error.HTTPError
segment within _get_json_data()
. Otherwise, instead of halting and returning None
, __new__()
will set rawData = None
and cause an error when trying to decode.
@nczeak - Can you submit a PR or give some line numbers? I'd love to have more confidence in pushing this code beyond a "beta release"
I have strict requirements regarding the timing of games, namely, I want to execute code when a game is exactly 10 minutes out. Over the last two years this has been inconsistent; I suspect it is this line, and that the game-center json is unavailable.
As I do not want to re-impliment nflgame.live in my project that uses nflgame; My inclination is to have nflgame.game.Game return game meta data even when there is no game-center json. I am trying to implement this with as little side effects as I can, but this likely has a LOT of implications throughout the code.