diff options
Diffstat (limited to 'src/silx/gui/data/HexaTableView.py')
-rw-r--r-- | src/silx/gui/data/HexaTableView.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/silx/gui/data/HexaTableView.py b/src/silx/gui/data/HexaTableView.py index 30f62f0..f50bf88 100644 --- a/src/silx/gui/data/HexaTableView.py +++ b/src/silx/gui/data/HexaTableView.py @@ -1,6 +1,6 @@ # /*########################################################################## # -# Copyright (c) 2017-2021 European Synchrotron Radiation Facility +# Copyright (c) 2017-2023 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 @@ -26,8 +26,6 @@ This module defines model and widget to display raw data using an hexadecimal viewer. """ -import collections - import numpy from silx.gui import qt @@ -46,7 +44,7 @@ class _VoidConnector(object): """ def __init__(self, data): - self.__cache = collections.OrderedDict() + self.__cache = {} self.__len = data.itemsize self.__data = data @@ -55,10 +53,10 @@ class _VoidConnector(object): pos = bufferId << 10 data = self.__data if hasattr(data, "tobytes"): - data = data.tobytes()[pos:pos + 1024] + data = data.tobytes()[pos : pos + 1024] else: # Old fashion - data = data.data[pos:pos + 1024] + data = data.data[pos : pos + 1024] self.__cache[bufferId] = data if len(self.__cache) > 32: @@ -98,6 +96,7 @@ class HexaTableModel(qt.QAbstractTableModel): :param qt.QObject parent: Parent object :param data: A numpy array or a h5py dataset """ + def __init__(self, parent=None, data=None): qt.QAbstractTableModel.__init__(self, parent) @@ -136,7 +135,7 @@ class HexaTableModel(qt.QAbstractTableModel): if role == qt.Qt.DisplayRole: if column == 0x10: - start = (row << 4) + start = row << 4 text = "" for i in range(0x10): pos = start + i @@ -236,6 +235,7 @@ class HexaTableView(qt.QTableView): It customs the column size to provide a better layout. """ + def __init__(self, parent=None): """ Constructor |