diff --git a/pyqtgraph/SRTTransform3D.py b/pyqtgraph/SRTTransform3D.py index 3c4edcc8..aedb200b 100644 --- a/pyqtgraph/SRTTransform3D.py +++ b/pyqtgraph/SRTTransform3D.py @@ -224,9 +224,9 @@ class SRTTransform3D(Transform3D): raise Exception("Argument 'nd' must be 2 or 3") if __name__ == '__main__': - import widgets + from . import widgets import GraphicsView - from functions import * + from .functions import * app = QtGui.QApplication([]) win = QtGui.QMainWindow() win.show() diff --git a/pyqtgraph/WidgetGroup.py b/pyqtgraph/WidgetGroup.py index 2792aa98..4656cc62 100644 --- a/pyqtgraph/WidgetGroup.py +++ b/pyqtgraph/WidgetGroup.py @@ -23,7 +23,7 @@ def restoreSplitter(w, s): if type(s) is list: w.setSizes(s) elif type(s) is str: - w.restoreState(QtCore.QByteArray.fromPercentEncoding(s)) + w.restoreState(QtCore.QByteArray.fromPercentEncoding(s.encode())) else: print("Can't configure QSplitter using object of type", type(s)) if w.count() > 0: ## make sure at least one item is not collapsed diff --git a/pyqtgraph/configfile.py b/pyqtgraph/configfile.py index 6ae8a0c5..fbedde4b 100644 --- a/pyqtgraph/configfile.py +++ b/pyqtgraph/configfile.py @@ -24,7 +24,7 @@ class ParseError(Exception): def __init__(self, message, lineNum, line, fileName=None): self.lineNum = lineNum self.line = line - #self.message = message + self.message = message self.fileName = fileName Exception.__init__(self, message) diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py index 98cf301e..079cef25 100644 --- a/pyqtgraph/functions.py +++ b/pyqtgraph/functions.py @@ -16,7 +16,6 @@ from .python2_3 import asUnicode, basestring from .Qt import QtGui, QtCore, QT_LIB from . import getConfigOption, setConfigOptions from . import debug, reload -from .reload import getPreviousVersion from .metaarray import MetaArray @@ -415,7 +414,7 @@ def makeArrowPath(headLen=20, headWidth=None, tipAngle=20, tailLen=20, tailWidth path.lineTo(0,0) return path - + def eq(a, b): """The great missing equivalence function: Guaranteed evaluation to a single bool value. diff --git a/pyqtgraph/graphicsItems/GradientEditorItem.py b/pyqtgraph/graphicsItems/GradientEditorItem.py index 942b280b..39d9b610 100644 --- a/pyqtgraph/graphicsItems/GradientEditorItem.py +++ b/pyqtgraph/graphicsItems/GradientEditorItem.py @@ -33,7 +33,7 @@ def addGradientListToDocstring(): """Decorator to add list of current pre-defined gradients to the end of a function docstring.""" def dec(fn): if fn.__doc__ is not None: - fn.__doc__ = fn.__doc__ + str(Gradients.keys()).strip('[').strip(']') + fn.__doc__ = fn.__doc__ + str(list(Gradients.keys())).strip('[').strip(']') return fn return dec diff --git a/pyqtgraph/graphicsItems/GraphicsItem.py b/pyqtgraph/graphicsItems/GraphicsItem.py index 1a522446..9daf2a92 100644 --- a/pyqtgraph/graphicsItems/GraphicsItem.py +++ b/pyqtgraph/graphicsItems/GraphicsItem.py @@ -1,3 +1,4 @@ +from functools import reduce from ..Qt import QtGui, QtCore, isQObjectAlive from ..GraphicsScene import GraphicsScene from ..Point import Point diff --git a/pyqtgraph/widgets/ColorMapWidget.py b/pyqtgraph/widgets/ColorMapWidget.py index b5e25d94..74e468c0 100644 --- a/pyqtgraph/widgets/ColorMapWidget.py +++ b/pyqtgraph/widgets/ColorMapWidget.py @@ -79,7 +79,7 @@ class ColorMapParameter(ptree.types.GroupParameter): return item def fieldNames(self): - return self.fields.keys() + return list(self.fields.keys()) def setFields(self, fields): """ diff --git a/pyqtgraph/widgets/TableWidget.py b/pyqtgraph/widgets/TableWidget.py index 0378b5fc..c0e6ea90 100644 --- a/pyqtgraph/widgets/TableWidget.py +++ b/pyqtgraph/widgets/TableWidget.py @@ -64,7 +64,7 @@ class TableWidget(QtGui.QTableWidget): self.setSortingEnabled(kwds.pop('sortable')) if len(kwds) > 0: - raise TypeError("Invalid keyword arguments '%s'" % kwds.keys()) + raise TypeError("Invalid keyword arguments '%s'" % list(kwds.keys())) self._sorting = None # used when temporarily disabling sorting