[hdf-compass] 163/295: Minor changes to add the same can_handle logging for all models
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Sun May 8 10:35:39 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 07423c8d55d17f9166e62a5e5d65ed0e778b887f
Author: giumas <giumas at yahoo.it>
Date: Tue Oct 20 16:37:04 2015 +0200
Minor changes to add the same can_handle logging for all models
---
hdf_compass/hdf5_model/model.py | 3 +++
hdf_compass/opendap_model/model.py | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/hdf_compass/hdf5_model/model.py b/hdf_compass/hdf5_model/model.py
index b6f590c..6f9f73f 100644
--- a/hdf_compass/hdf5_model/model.py
+++ b/hdf_compass/hdf5_model/model.py
@@ -70,10 +70,13 @@ class HDF5Store(compass_model.Store):
@staticmethod
def can_handle(url):
if not url.startswith('file://'):
+ log.debug("able to handle %s? no, not starting with file://" % url)
return False
path = url2path(url)
if not h5py.is_hdf5(path):
+ log.debug("able to handle %s? no, not hdf5 file" % url)
return False
+ log.debug("able to handle %s? yes" % url)
return True
def __init__(self, url):
diff --git a/hdf_compass/opendap_model/model.py b/hdf_compass/opendap_model/model.py
index 25ce931..d7f7158 100644
--- a/hdf_compass/opendap_model/model.py
+++ b/hdf_compass/opendap_model/model.py
@@ -49,8 +49,11 @@ class Server(compass_model.Store):
@staticmethod
def can_handle(url):
try:
- return isinstance(open_url(url), dap.model.DatasetType)
+ flag = isinstance(open_url(url), dap.model.DatasetType)
+ log.debug("able to handle %s? %r" % (url, flag))
+ return flag
except Exception:
+ log.debug("able to handle %s? no" % url)
return False
def __init__(self, url):
--
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