Skip to content
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

Cache location area encounters #12

Closed

Conversation

jrubinator
Copy link

This caches location area encounters, per issue #10

There's some logic in here to make sure that PokeAPI/pokeapi#335 doesn't have any impact here.

NamedAPIResource's load() does this for us. We can trust it.
This is step one to extending it
This separate __is_loaded from __init__
which will eventually allow inheriting classes to override
__init__ without worrying about name-mangling
This moves the final name-mangling outside of __init__
so that inheritance is truly possible
In addition to creating the resource, the biggest architecture change
is making lookup_data accept a url separate from the subdir structure.

This seemed less confusing than creating numerical directories in the
pokemon cache, instead keeping them all inside the encounters subdir
@jrubinator
Copy link
Author

Hmmm, apparently I removed some cachedir-creating code. Looking into it.

@GregHilmes
Copy link
Collaborator

Thank you for your contribution @jrubinator, and your patients (sorry for the delay here). I'm currently making several big improvements under the hood of pokebase. Unfortunately this means the changes you suggested no longer make sense with the current code state, so I have to close this PR. However, in the coming commits I intend to add support for subresources from the API, so keep your eye out for those (I had no idea subresources were even a thing, thanks for calling that to my attention).

@GregHilmes GregHilmes closed this Jun 28, 2018
@jrubinator
Copy link
Author

@GregHilmes - no problem! I look forward to seeing the enhancements :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants