[hdf-compass] 203/295: display attribute count

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun May 8 10:35:45 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 855b9b1dd8f1d0b8302992bc5edca84555cfd4a9
Author: jreadey <jreadey at hdfgroup.org>
Date:   Wed Oct 28 15:52:09 2015 -0700

    display attribute count
---
 hdf_compass/compass_viewer/info.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/hdf_compass/compass_viewer/info.py b/hdf_compass/compass_viewer/info.py
index 72ccc37..d74b029 100644
--- a/hdf_compass/compass_viewer/info.py
+++ b/hdf_compass/compass_viewer/info.py
@@ -89,12 +89,23 @@ def describe(node):
     desc = "%s\n\n" % type(node).class_kind
 
     if isinstance(node, compass_model.Array):
-        desc += "Shape\n%s\n\nType\n%s" % \
+        desc += "Shape\n%s\n\nType\n%s\n" % \
                 (node.shape, dtype_text(node.dtype))
 
     elif isinstance(node, compass_model.Container):
         desc += "%d items\n" % len(node)
-
+    
+    if not isinstance(node, compass_model.KeyValue):    
+        # see if there is a key-value handler for this node
+        handlers = node.store.gethandlers(node.key)
+        for h in handlers:
+            
+            kv_node = h(node.store, node.key)
+            if isinstance(kv_node, compass_model.KeyValue):
+                num_keys = len(kv_node.keys)
+                if num_keys > 0:
+                    desc += "\n%d %s\n" % (len(kv_node.keys), type(kv_node).class_kind)
+            
     return desc
 
 

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