[Scipy-svn] r3421 - trunk/scipy/io
Sun Oct 7 01:08:07 CDT 2007
Date: 2007-10-07 01:08:03 -0500 (Sun, 07 Oct 2007)
New Revision: 3421
bugfix datasource handling of leading slash
--- trunk/scipy/io/datasource.py 2007-10-06 15:47:55 UTC (rev 3420)
+++ trunk/scipy/io/datasource.py 2007-10-07 06:08:03 UTC (rev 3421)
@@ -17,14 +17,14 @@
-# datasource has been used for a while in the NiPy project for analyzing
+# datasource has been used for a while in the NIPY project for analyzing
# large fmri imaging files hosted over a network. Data would be fetched
# via URLs, cached locally and analyzed. Under these conditions the code
# worked well, however it needs to be documented, tested and reviewed
# before being fully exposed to SciPy. We hope to do this before the
# 0.7 release.
_api_warning = "The datasource API will be changing frequently before \
-the 0.7 release as the code is ported from the NiPy project to SciPy. \
+the 0.7 release as the code is ported from the NIPY project to SciPy. \
Some of the current public interface may become private during the port! \
Use this module minimally, if at all, until it is stabilized."
@@ -210,15 +210,14 @@
>>> mycache = datasource.Cache()
# TODO: Change to non-public?
- # TODO: BUG: First character is removed in the returned path. Why?
# It appears the Cache is designed to work with URLs only!
(_tmp, netloc, upath, _tmp, _tmp, _tmp) = urlparse(uri)
- return self.path.joinpath(netloc, upath[1:])
+ return self.path.joinpath(netloc, upath.strip('/'))
def filename(self, uri):
"""Return the complete path + filename within the cache.
@@ -364,6 +363,7 @@
#"""DataSource with an implied root."""
def __init__(self, baseurl, cachepath=None):
self._baseurl = baseurl
More information about the Scipy-svn