[h5py] 238/455: Setup & completer patches from D. Dale. Thanks!

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:37 UTC 2015


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

ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.

commit 1110b004f16e724c3eb9bfddbad0eabdb5879fc7
Author: andrewcollette <andrew.collette at gmail.com>
Date:   Thu Apr 9 18:48:03 2009 +0000

    Setup & completer patches from D. Dale. Thanks!
---
 h5py/_ipy_completer.py | 21 ++++++++-------------
 setup.py               |  8 +++++---
 2 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/h5py/_ipy_completer.py b/h5py/_ipy_completer.py
index dc90095..8a0a172 100644
--- a/h5py/_ipy_completer.py
+++ b/h5py/_ipy_completer.py
@@ -1,24 +1,19 @@
 #+
-# 
+#
 # This file is part of h5py, a low-level Python interface to the HDF5 library.
-# 
+#
 # Contributed by Darren Dale
 #
 # Copyright (C) 2009 Darren Dale
 #
 # http://h5py.alfven.org
 # License: BSD  (See LICENSE.txt for full license)
-# 
+#
 #-
 
 """
-h5py completer extension for ipython. Drop this file in your ~/.ipython direcory
-and add the following lines to ~/.ipython/ipy_user_conf.py main()::
-
-  from ipy_h5py_completer.py import activate
-  activate()
-
-It will let you do things like::
+h5py completer extension for ipython. This completer is automatically loaded
+when h5py is imported within ipython. It will let you do things like::
 
   f=File('foo.h5')
   f['<tab>
@@ -73,12 +68,12 @@ def h5py_item_completer(context, command):
     except:
         return []
 
-    path, item = posixpath.split(item)
+    path, target = posixpath.split(item)
     if path:
-        target = obj[path]
-        items = (posixpath.join(path, item) for item in target.iternames())
+        items = (posixpath.join(path, name) for name in obj[path].iternames())
     else:
         items = obj.iternames()
+    items = list(items)
 
     readline.set_completer_delims(' \t\n`!@#$^&*()=+[{]}\\|;:\'",<>?')
 
diff --git a/setup.py b/setup.py
index 6f3b903..a6fcdb0 100644
--- a/setup.py
+++ b/setup.py
@@ -284,9 +284,11 @@ class configure(Command):
             print "HDF5 path: %s\nAPI setting: %s" % (hdf5, api)
             return
 
-        if self.hdf5 is not None and not op.isdir(self.hdf5):
-            fatal("Invalid HDF5 path: %s" % self.hdf5)
-        self.hdf5 = op.abspath(self.hdf5)
+        if self.hdf5 is not None:
+            if op.isdir(self.hdf5):
+                self.hdf5 = op.abspath(self.hdf5)
+            else:
+                fatal("Invalid HDF5 path: %s" % self.hdf5)
         if self.api is not None and self.api not in ('16','18'):
             fatal("Invalid API level %s (must be 16 or 18)" % self.api)
 

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



More information about the debian-science-commits mailing list