John Hunter <jdh2358@...149...> writes:
* I commented out the random number appending, because I do not see
the use case, but we can re-add it when you enlighten me
I did that in case someone wanted to retrieve files from several
different locations -- my version of the cache handler was not tied to
any particular base URL. Since all cached files were in one flat
directory, there was the danger of filename collisions.
* I added support for nested subdirs, so you can now do, as in
examples/misc/sample_data_test.py::datafile = 'testdir/subdir/testsub.csv'
fh = cbook.get_sample_data(datafile)
I think mirroring a directory structure is somewhat more complicated
than caching a set of arbitrary URLs in a flat cache directory. For
example, I think the remove_stale_files method will need to be changed
to walk all subdirectories, and handling cases such as having a
subdirectory named foo that is replaced by a file named foo could be
complicated.
One thing that's still missing is off-line usage: if the user does not
have net connectivity at the moment but does have the file in the cache,
it should not cause an error.
Perhaps the base URL should be
instead of
to avoid dependency on the viewvc service of SourceForge.
路路路
--
Jouni K. Sepp锟絥en