Revision: 6070
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6070&view=rev
Author:   jswhit
Date:     2008-09-05 15:37:01 +0000 (Fri, 05 Sep 2008)

Log Message:
-----------
allow for 'cache' option when accessing remote datasets.

Modified Paths:
--------------
    trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
    trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdf.py

Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-09-05 
13:23:21 UTC (rev 6069)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-09-05 
15:37:01 UTC (rev 6070)
@@ -3646,7 +3646,8 @@
     else:
         return corners
 
-def NetCDFFile(file, mode='r', maskandscale=True, username=None, 
password=None):
+def NetCDFFile(file, mode='r', maskandscale=True, cache=None,\
+               username=None, password=None, verbose=False):
     """NetCDF File reader/writer.  API is the same as Scientific.IO.NetCDF.
 
     If ``file`` is a URL that starts with `http`, it is assumed
@@ -3666,9 +3667,17 @@
     To suppress these automatic conversions, set the ``maskandscale``
     keyword to False. 
 
+    The keywords ``cache``, ``username``, ``password`` and ``verbose`` are only
+    valid for remote OPenDAP datasets.  ``username`` and ``password`` are used 
+    to access OPenDAP datasets that require authentication.  ``verbose=True``
+    will make the pydap client print out the URLs being accessed.
+    ``cache`` is a location (a directory) for caching data, so that repeated
+    accesses to the same URL avoid the network. 
+
     """
     if file.startswith('http'):
-        return 
netcdf._RemoteFile(file,maskandscale=maskandscale,username=username,password=password)
+        return netcdf._RemoteFile(file,maskandscale=maskandscale,\
+        cache=cache,username=username,password=password,verbose=verbose)
     else:
         return netcdf.netcdf_file(file,mode=mode,maskandscale=maskandscale)
 

Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdf.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdf.py   2008-09-05 
13:23:21 UTC (rev 6069)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdf.py   2008-09-05 
15:37:01 UTC (rev 6070)
@@ -8,8 +8,10 @@
 class _RemoteFile(object):
     """A NetCDF file reader. API is the same as Scientific.IO.NetCDF."""
 
-    def __init__(self, file, maskandscale=False, username=None, password=None):
-        self._buffer = open_remote(file,username=username,password=password)
+    def __init__(self, file, maskandscale=False, cache=None,\
+                 username=None, password=None, verbose=False):
+        self._buffer = open_remote(file,cache=cache,\
+                       username=username,password=password,verbose=verbose)
         self._maskandscale = maskandscale
         self._parse()
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to