Repository navigation
Dealing with different shelve backends - #65
Jackomatrus wants to merge 5 commits into
Conversation
|
Great addition, thanks a lot. We can merge |
|
Should we document the new function somewhere? |
|
This is my first contribution to a public project, so I am not sure if (or where) we should. |
|
Maybe @Jackomatrus we can rename the function you added to something like |
|
I renamed the function to delete_cache (emptying the cache would suggest the cache to still be there but without data - the function actually deletes the files however). I also made the function set CACHE_DIR, API_CACHE, and SPRITE_CACHE to None as otherwise they would point to non-existing paths after running delete_cache. I added an example to the readme. |
|
I ran the pipeline and the test are failing, could you take a look? After deleting the cache would be there a way to recreate it? |
|
Sorry for missing that, I missed a functionality of shelve where shelve.open(path) creates the necessary files even if they were deleted. Tests now passed on my machine. |
|
Can you try again? I accidentally joined paths without checking for OS. I tested on both linux and windows now |
Tests were failing on my machine due to shelve creating three different cache files (api.cache.bak, api.cache.dat, and api.cache.dir). Only using os.remove() on api.cache might not work depending on the backend that the shelve module uses.
Shelve does not offer a native way to detect which files it created, so a glob pattern finds them all