On Tue, Aug 4, 2009 at 2:45 PM, Jouni K. Seppänen<j...@iki.fi> wrote:
> John Hunter <jdh2...@gmail.com> writes:
>
>>     # TODO: how to handle stale data in the cache that has been
>>     # updated from svn -- is there a clean http way to get the current
>>     # revision number that will not leave us at the mercy of html
>>     # changes at sf?
>
> The mod_dav_svn server sends an ETag header that happens to contain the
> revision number where the file was last modified, and a Last-Modified
> header that contains the date of that revision. The clean http way to
> make use of these is to make a conditional request - I hacked up a
> processor class for urllib2 that does this, and checked it in.

Also, it would be preferable for the returned file object which
supports the "seek" method.  This is what cbook.to_filehandle checks
for, and what mlab.csv2rec uses to rewind the file after doing a data
introspection pass through to get the data types.  Eg,

>>> import matplotlib.mlab as mlab
>>> import matplotlib.cbook as cbook
>>> r = mlab.csv2rec( cbook.get_mpl_data('testdata.csv') )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jdhunter/dev/lib/python2.6/site-packages/matplotlib/mlab.py",
line 2108, in csv2rec
    fh = cbook.to_filehandle(fname)
  File "/Users/jdhunter/dev/lib/python2.6/site-packages/matplotlib/cbook.py",
line 339, in to_filehandle
    raise ValueError('fname must be a string or file handle')
ValueError: fname must be a string or file handle

Perhaps we could return a plain file handle pointing to the cached data?

JDH

------------------------------------------------------------------------------
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

Reply via email to