From cebdc9244c019224846cb8d2668080fe386a6adc Mon Sep 17 00:00:00 2001 From: Alexandre Marie Date: Mon, 17 Dec 2018 12:28:24 +0100 Subject: New upstream version 0.9.0+dfsg --- silx/app/view/About.py | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) (limited to 'silx/app/view/About.py') diff --git a/silx/app/view/About.py b/silx/app/view/About.py index 07306ef..4b804f2 100644 --- a/silx/app/view/About.py +++ b/silx/app/view/About.py @@ -25,7 +25,7 @@ __authors__ = ["V. Valls"] __license__ = "MIT" -__date__ = "05/06/2018" +__date__ = "05/07/2018" import sys @@ -147,6 +147,15 @@ class About(qt.QDialog): template = '%s is not loaded' return template % name + @staticmethod + def __formatOptionalFilters(name, isAvailable): + """Utils to format availability of features""" + if isAvailable: + template = '%s is available' + else: + template = '%s is not available' + return template % name + def __updateText(self): """Update the content of the dialog according to the settings.""" import silx._version @@ -174,14 +183,29 @@ class About(qt.QDialog):

""" - hdf5pluginLoaded = "hdf5plugin" in sys.modules - fabioLoaded = "fabio" in sys.modules - h5pyLoaded = "h5py" in sys.modules - - optional_lib = [] - optional_lib.append(self.__formatOptionalLibraries("FabIO", fabioLoaded)) - optional_lib.append(self.__formatOptionalLibraries("H5py", h5pyLoaded)) - optional_lib.append(self.__formatOptionalLibraries("hdf5plugin", hdf5pluginLoaded)) + optionals = [] + optionals.append(self.__formatOptionalLibraries("H5py", "h5py" in sys.modules)) + optionals.append(self.__formatOptionalLibraries("FabIO", "fabio" in sys.modules)) + + try: + import h5py.version + if h5py.version.hdf5_version_tuple >= (1, 10, 2): + # Previous versions only return True if the filter was first used + # to decode a dataset + import h5py.h5z + FILTER_LZ4 = 32004 + FILTER_BITSHUFFLE = 32008 + filters = [ + ("HDF5 LZ4 filter", FILTER_LZ4), + ("HDF5 Bitshuffle filter", FILTER_BITSHUFFLE), + ] + for name, filterId in filters: + isAvailable = h5py.h5z.filter_avail(filterId) + optionals.append(self.__formatOptionalFilters(name, isAvailable)) + else: + optionals.append(self.__formatOptionalLibraries("hdf5plugin", "hdf5plugin" in sys.modules)) + except ImportError: + pass # Access to the logo in SVG or PNG logo = icons.getQFile("../logo/silx") @@ -194,7 +218,7 @@ class About(qt.QDialog): qt_binding=qt.BINDING, qt_version=qt.qVersion(), python_version=sys.version.replace("\n", "
"), - optional_lib="
".join(optional_lib), + optional_lib="
".join(optionals), silx_image_path=logo.fileName() ) -- cgit v1.2.3