On Wed, Aug 5, 2009 at 7:11 AM, John Hunter<jdh2...@gmail.com> wrote:
> Perhaps we could return a plain file handle pointing to the cached data? OK, I've made a few changes to the code so Jouni you will probably want to review them * I renamed the svn repo and function to be "sample_data" rather than "mpl_data" to avoid confusion with lib/matplotlib/mpl-data. The svn repo, the examples and the cbook function have all been renamed. The repo is :: svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/sample_data and the examples are:: jo...@udesktop191:mpl> ls examples/misc/sam*.py examples/misc/sample_data_demo.py examples/misc/sample_data_test.py * 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 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 always return a file handle to the cached file, so seek works, and is exercised in examples/misc/sample_data_test.py It is probably worth doing a little more work to make the processor plus the "get_sample_data" function all part of one class, so other people can reuse it with other repos and other dirs. Eg, something like the following in cbook:: myserver = ViewVCCacheServer(mycachedir, myurlbase) get_sample_data = myserver.get_sample_data ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel