diff options
Diffstat (limited to 'examples/hdf5widget.py')
-rwxr-xr-x | examples/hdf5widget.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/hdf5widget.py b/examples/hdf5widget.py index 0d45b8f..82ce27d 100755 --- a/examples/hdf5widget.py +++ b/examples/hdf5widget.py @@ -2,7 +2,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2016-2019 European Synchrotron Radiation Facility +# Copyright (c) 2016-2021 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -25,12 +25,12 @@ # ###########################################################################*/ """Qt Hdf5 widget examples""" +import html import logging import sys import tempfile import numpy -import six logging.basicConfig() _logger = logging.getLogger("hdf5widget") @@ -46,7 +46,6 @@ except ImportError: import h5py import silx.gui.hdf5 -import silx.utils.html from silx.gui import qt from silx.gui.data.DataViewerFrame import DataViewerFrame from silx.gui.widgets.ThreadPoolPushButton import ThreadPoolPushButton @@ -59,7 +58,7 @@ _file_cache = {} def str_attrs(str_list): """Return a numpy array of unicode strings""" - text_dtype = h5py.special_dtype(vlen=six.text_type) + text_dtype = h5py.special_dtype(vlen=str) return numpy.array(str_list, dtype=text_dtype) @@ -573,7 +572,7 @@ class Hdf5TreeViewExample(qt.QMainWindow): """Called to log event in widget """ def formatKey(name, value): - name, value = silx.utils.html.escape(str(name)), silx.utils.html.escape(str(value)) + name, value = html.escape(str(name)), html.escape(str(value)) return "<li><b>%s</b>: %s</li>" % (name, value) text = "<html>" @@ -791,7 +790,7 @@ def main(filenames): sys.excepthook = qt.exceptionHandler window = Hdf5TreeViewExample(filenames) window.show() - result = app.exec_() + result = app.exec() # remove ending warnings relative to QTimer app.deleteLater() sys.exit(result) |