[hdf-compass] 92/295: Fix for URI implementation on Window

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun May 8 10:35:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/master
in repository hdf-compass.

commit 1f26c3f1775bb58205e11370c246c9a029f01d2a
Author: giumas <giumas at yahoo.it>
Date:   Sun Sep 27 22:18:14 2015 -0400

    Fix for URI implementation on Window
---
 hdf5_model/__init__.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/hdf5_model/__init__.py b/hdf5_model/__init__.py
index f583de3..ead23a4 100644
--- a/hdf5_model/__init__.py
+++ b/hdf5_model/__init__.py
@@ -15,7 +15,7 @@ Implementation of compass_model classes for HDF5 files.
 """
 
 from itertools import groupby
-import os
+import sys
 import os.path as op
 import posixpath as pp
 import numpy as np
@@ -74,7 +74,10 @@ class HDF5Store(compass_model.Store):
     def canhandle(url):
         if not url.startswith('file://'):
             return False
-        path = url.replace('file://','')
+        if sys.platform == 'win32':
+            path = url.replace('file:///', '')
+        else:
+            path = url.replace('file://', '')
         if not h5py.is_hdf5(path):
             return False
         return True
@@ -84,7 +87,10 @@ class HDF5Store(compass_model.Store):
         if not self.canhandle(url):
             raise ValueError(url)
         self._url = url
-        path = url.replace('file://','')
+        if sys.platform == 'win32':
+            path = url.replace('file:///', '')
+        else:
+            path = url.replace('file://', '')
         self.f = h5py.File(path, 'r')
         
     def close(self):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/hdf-compass.git



More information about the debian-science-commits mailing list