diff --git a/pyqtgraph/GraphicsScene/GraphicsScene.py b/pyqtgraph/GraphicsScene/GraphicsScene.py
index 3fdd5924..d61a1fa4 100644
--- a/pyqtgraph/GraphicsScene/GraphicsScene.py
+++ b/pyqtgraph/GraphicsScene/GraphicsScene.py
@@ -1,19 +1,11 @@
-from pyqtgraph.Qt import QtCore, QtGui
-
-from pyqtgraph.python2_3 import sortList
-#try:
- #from PyQt4 import QtOpenGL
- #HAVE_OPENGL = True
-#except ImportError:
- #HAVE_OPENGL = False
-
+from ..Qt import QtCore, QtGui
+from ..python2_3 import sortList
import weakref
-from pyqtgraph.Point import Point
-import pyqtgraph.functions as fn
-import pyqtgraph.ptime as ptime
+from ..Point import Point
+from .. import functions as fn
+from .. import ptime as ptime
from .mouseEvents import *
-import pyqtgraph.debug as debug
-from . import exportDialog
+from .. import debug as debug
if hasattr(QtCore, 'PYQT_VERSION'):
try:
@@ -552,6 +544,7 @@ class GraphicsScene(QtGui.QGraphicsScene):
def showExportDialog(self):
if self.exportDialog is None:
+ from . import exportDialog
self.exportDialog = exportDialog.ExportDialog(self)
self.exportDialog.show(self.contextMenuItem)
diff --git a/pyqtgraph/GraphicsScene/exportDialog.py b/pyqtgraph/GraphicsScene/exportDialog.py
index 436d5e42..5efb7c44 100644
--- a/pyqtgraph/GraphicsScene/exportDialog.py
+++ b/pyqtgraph/GraphicsScene/exportDialog.py
@@ -1,6 +1,8 @@
-from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE
-import pyqtgraph as pg
-import pyqtgraph.exporters as exporters
+from ..Qt import QtCore, QtGui, USE_PYSIDE
+from .. import exporters as exporters
+from .. import functions as fn
+from ..graphicsItems.ViewBox import ViewBox
+from ..graphicsItems.PlotItem import PlotItem
if USE_PYSIDE:
from . import exportDialogTemplate_pyside as exportDialogTemplate
@@ -18,7 +20,7 @@ class ExportDialog(QtGui.QWidget):
self.scene = scene
self.selectBox = QtGui.QGraphicsRectItem()
- self.selectBox.setPen(pg.mkPen('y', width=3, style=QtCore.Qt.DashLine))
+ self.selectBox.setPen(fn.mkPen('y', width=3, style=QtCore.Qt.DashLine))
self.selectBox.hide()
self.scene.addItem(self.selectBox)
@@ -35,10 +37,10 @@ class ExportDialog(QtGui.QWidget):
def show(self, item=None):
if item is not None:
## Select next exportable parent of the item originally clicked on
- while not isinstance(item, pg.ViewBox) and not isinstance(item, pg.PlotItem) and item is not None:
+ while not isinstance(item, ViewBox) and not isinstance(item, PlotItem) and item is not None:
item = item.parentItem()
## if this is a ViewBox inside a PlotItem, select the parent instead.
- if isinstance(item, pg.ViewBox) and isinstance(item.parentItem(), pg.PlotItem):
+ if isinstance(item, ViewBox) and isinstance(item.parentItem(), PlotItem):
item = item.parentItem()
self.updateItemList(select=item)
self.setVisible(True)
@@ -64,9 +66,9 @@ class ExportDialog(QtGui.QWidget):
def updateItemTree(self, item, treeItem, select=None):
si = None
- if isinstance(item, pg.ViewBox):
+ if isinstance(item, ViewBox):
si = QtGui.QTreeWidgetItem(['ViewBox'])
- elif isinstance(item, pg.PlotItem):
+ elif isinstance(item, PlotItem):
si = QtGui.QTreeWidgetItem(['Plot'])
if si is not None:
diff --git a/pyqtgraph/GraphicsScene/exportDialogTemplate.ui b/pyqtgraph/GraphicsScene/exportDialogTemplate.ui
index c91fbc3f..eacacd88 100644
--- a/pyqtgraph/GraphicsScene/exportDialogTemplate.ui
+++ b/pyqtgraph/GraphicsScene/exportDialogTemplate.ui
@@ -92,7 +92,7 @@
ParameterTree
QTreeWidget
-
+
diff --git a/pyqtgraph/GraphicsScene/exportDialogTemplate_pyqt.py b/pyqtgraph/GraphicsScene/exportDialogTemplate_pyqt.py
index c3056d1c..ad7361ab 100644
--- a/pyqtgraph/GraphicsScene/exportDialogTemplate_pyqt.py
+++ b/pyqtgraph/GraphicsScene/exportDialogTemplate_pyqt.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './GraphicsScene/exportDialogTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/GraphicsScene/exportDialogTemplate.ui'
#
-# Created: Wed Jan 30 21:02:28 2013
-# by: PyQt4 UI code generator 4.9.3
+# Created: Mon Dec 23 10:10:52 2013
+# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
- _fromUtf8 = lambda s: s
+ def _fromUtf8(s):
+ return s
+
+try:
+ _encoding = QtGui.QApplication.UnicodeUTF8
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig, _encoding)
+except AttributeError:
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
@@ -57,12 +66,12 @@ class Ui_Form(object):
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
- Form.setWindowTitle(QtGui.QApplication.translate("Form", "Export", None, QtGui.QApplication.UnicodeUTF8))
- self.label.setText(QtGui.QApplication.translate("Form", "Item to export:", None, QtGui.QApplication.UnicodeUTF8))
- self.label_2.setText(QtGui.QApplication.translate("Form", "Export format", None, QtGui.QApplication.UnicodeUTF8))
- self.exportBtn.setText(QtGui.QApplication.translate("Form", "Export", None, QtGui.QApplication.UnicodeUTF8))
- self.closeBtn.setText(QtGui.QApplication.translate("Form", "Close", None, QtGui.QApplication.UnicodeUTF8))
- self.label_3.setText(QtGui.QApplication.translate("Form", "Export options", None, QtGui.QApplication.UnicodeUTF8))
- self.copyBtn.setText(QtGui.QApplication.translate("Form", "Copy", None, QtGui.QApplication.UnicodeUTF8))
+ Form.setWindowTitle(_translate("Form", "Export", None))
+ self.label.setText(_translate("Form", "Item to export:", None))
+ self.label_2.setText(_translate("Form", "Export format", None))
+ self.exportBtn.setText(_translate("Form", "Export", None))
+ self.closeBtn.setText(_translate("Form", "Close", None))
+ self.label_3.setText(_translate("Form", "Export options", None))
+ self.copyBtn.setText(_translate("Form", "Copy", None))
-from pyqtgraph.parametertree import ParameterTree
+from ..parametertree import ParameterTree
diff --git a/pyqtgraph/GraphicsScene/exportDialogTemplate_pyside.py b/pyqtgraph/GraphicsScene/exportDialogTemplate_pyside.py
index cf27f60a..f2e8dc70 100644
--- a/pyqtgraph/GraphicsScene/exportDialogTemplate_pyside.py
+++ b/pyqtgraph/GraphicsScene/exportDialogTemplate_pyside.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './GraphicsScene/exportDialogTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/GraphicsScene/exportDialogTemplate.ui'
#
-# Created: Wed Jan 30 21:02:28 2013
-# by: pyside-uic 0.2.13 running on PySide 1.1.1
+# Created: Mon Dec 23 10:10:53 2013
+# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
@@ -60,4 +60,4 @@ class Ui_Form(object):
self.label_3.setText(QtGui.QApplication.translate("Form", "Export options", None, QtGui.QApplication.UnicodeUTF8))
self.copyBtn.setText(QtGui.QApplication.translate("Form", "Copy", None, QtGui.QApplication.UnicodeUTF8))
-from pyqtgraph.parametertree import ParameterTree
+from ..parametertree import ParameterTree
diff --git a/pyqtgraph/GraphicsScene/mouseEvents.py b/pyqtgraph/GraphicsScene/mouseEvents.py
index 0b71ac6f..f337a657 100644
--- a/pyqtgraph/GraphicsScene/mouseEvents.py
+++ b/pyqtgraph/GraphicsScene/mouseEvents.py
@@ -1,7 +1,7 @@
-from pyqtgraph.Point import Point
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Point import Point
+from ..Qt import QtCore, QtGui
import weakref
-import pyqtgraph.ptime as ptime
+from .. import ptime as ptime
class MouseDragEvent(object):
"""
diff --git a/pyqtgraph/SRTTransform.py b/pyqtgraph/SRTTransform.py
index efb24f60..23281343 100644
--- a/pyqtgraph/SRTTransform.py
+++ b/pyqtgraph/SRTTransform.py
@@ -2,7 +2,6 @@
from .Qt import QtCore, QtGui
from .Point import Point
import numpy as np
-import pyqtgraph as pg
class SRTTransform(QtGui.QTransform):
"""Transform that can always be represented as a combination of 3 matrices: scale * rotate * translate
@@ -77,7 +76,7 @@ class SRTTransform(QtGui.QTransform):
self.update()
def setFromMatrix4x4(self, m):
- m = pg.SRTTransform3D(m)
+ m = SRTTransform3D(m)
angle, axis = m.getRotation()
if angle != 0 and (axis[0] != 0 or axis[1] != 0 or axis[2] != 1):
print("angle: %s axis: %s" % (str(angle), str(axis)))
@@ -256,4 +255,4 @@ if __name__ == '__main__':
w1.sigRegionChanged.connect(update)
#w2.sigRegionChanged.connect(update2)
-
\ No newline at end of file
+from .SRTTransform3D import SRTTransform3D
diff --git a/pyqtgraph/SRTTransform3D.py b/pyqtgraph/SRTTransform3D.py
index 7d87dcb8..417190e1 100644
--- a/pyqtgraph/SRTTransform3D.py
+++ b/pyqtgraph/SRTTransform3D.py
@@ -1,17 +1,17 @@
# -*- coding: utf-8 -*-
from .Qt import QtCore, QtGui
from .Vector import Vector
-from .SRTTransform import SRTTransform
-import pyqtgraph as pg
+from .Transform3D import Transform3D
+from .Vector import Vector
import numpy as np
import scipy.linalg
-class SRTTransform3D(pg.Transform3D):
+class SRTTransform3D(Transform3D):
"""4x4 Transform matrix that can always be represented as a combination of 3 matrices: scale * rotate * translate
This transform has no shear; angles are always preserved.
"""
def __init__(self, init=None):
- pg.Transform3D.__init__(self)
+ Transform3D.__init__(self)
self.reset()
if init is None:
return
@@ -44,14 +44,14 @@ class SRTTransform3D(pg.Transform3D):
def getScale(self):
- return pg.Vector(self._state['scale'])
+ return Vector(self._state['scale'])
def getRotation(self):
"""Return (angle, axis) of rotation"""
- return self._state['angle'], pg.Vector(self._state['axis'])
+ return self._state['angle'], Vector(self._state['axis'])
def getTranslation(self):
- return pg.Vector(self._state['pos'])
+ return Vector(self._state['pos'])
def reset(self):
self._state = {
@@ -169,7 +169,7 @@ class SRTTransform3D(pg.Transform3D):
def as2D(self):
"""Return a QTransform representing the x,y portion of this transform (if possible)"""
- return pg.SRTTransform(self)
+ return SRTTransform(self)
#def __div__(self, t):
#"""A / B == B^-1 * A"""
@@ -202,11 +202,11 @@ class SRTTransform3D(pg.Transform3D):
self.update()
def update(self):
- pg.Transform3D.setToIdentity(self)
+ Transform3D.setToIdentity(self)
## modifications to the transform are multiplied on the right, so we need to reverse order here.
- pg.Transform3D.translate(self, *self._state['pos'])
- pg.Transform3D.rotate(self, self._state['angle'], *self._state['axis'])
- pg.Transform3D.scale(self, *self._state['scale'])
+ Transform3D.translate(self, *self._state['pos'])
+ Transform3D.rotate(self, self._state['angle'], *self._state['axis'])
+ Transform3D.scale(self, *self._state['scale'])
def __repr__(self):
return str(self.saveState())
@@ -311,4 +311,4 @@ if __name__ == '__main__':
w1.sigRegionChanged.connect(update)
#w2.sigRegionChanged.connect(update2)
-
\ No newline at end of file
+from .SRTTransform import SRTTransform
diff --git a/pyqtgraph/ThreadsafeTimer.py b/pyqtgraph/ThreadsafeTimer.py
index f2de9791..201469de 100644
--- a/pyqtgraph/ThreadsafeTimer.py
+++ b/pyqtgraph/ThreadsafeTimer.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtCore, QtGui
+from .Qt import QtCore, QtGui
class ThreadsafeTimer(QtCore.QObject):
"""
diff --git a/pyqtgraph/Transform3D.py b/pyqtgraph/Transform3D.py
index aa948e28..43b12de3 100644
--- a/pyqtgraph/Transform3D.py
+++ b/pyqtgraph/Transform3D.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from .Qt import QtCore, QtGui
-import pyqtgraph as pg
+from . import functions as fn
import numpy as np
class Transform3D(QtGui.QMatrix4x4):
@@ -26,7 +26,7 @@ class Transform3D(QtGui.QMatrix4x4):
Extends QMatrix4x4.map() to allow mapping (3, ...) arrays of coordinates
"""
if isinstance(obj, np.ndarray) and obj.ndim >= 2 and obj.shape[0] in (2,3):
- return pg.transformCoordinates(self, obj)
+ return fn.transformCoordinates(self, obj)
else:
return QtGui.QMatrix4x4.map(self, obj)
diff --git a/pyqtgraph/canvas/Canvas.py b/pyqtgraph/canvas/Canvas.py
index 17a39c2b..d07b3428 100644
--- a/pyqtgraph/canvas/Canvas.py
+++ b/pyqtgraph/canvas/Canvas.py
@@ -3,29 +3,21 @@ if __name__ == '__main__':
import sys, os
md = os.path.dirname(os.path.abspath(__file__))
sys.path = [os.path.dirname(md), os.path.join(md, '..', '..', '..')] + sys.path
- #print md
-
-#from pyqtgraph.GraphicsView import GraphicsView
-#import pyqtgraph.graphicsItems as graphicsItems
-#from pyqtgraph.PlotWidget import PlotWidget
-from pyqtgraph.Qt import QtGui, QtCore, USE_PYSIDE
-from pyqtgraph.graphicsItems.ROI import ROI
-from pyqtgraph.graphicsItems.ViewBox import ViewBox
-from pyqtgraph.graphicsItems.GridItem import GridItem
+from ..Qt import QtGui, QtCore, USE_PYSIDE
+from ..graphicsItems.ROI import ROI
+from ..graphicsItems.ViewBox import ViewBox
+from ..graphicsItems.GridItem import GridItem
if USE_PYSIDE:
from .CanvasTemplate_pyside import *
else:
from .CanvasTemplate_pyqt import *
-#import DataManager
import numpy as np
-from pyqtgraph import debug
-#import pyqtgraph as pg
+from .. import debug
import weakref
from .CanvasManager import CanvasManager
-#import items
from .CanvasItem import CanvasItem, GroupCanvasItem
class Canvas(QtGui.QWidget):
@@ -605,4 +597,4 @@ class SelectBox(ROI):
-
\ No newline at end of file
+
diff --git a/pyqtgraph/canvas/CanvasItem.py b/pyqtgraph/canvas/CanvasItem.py
index 81388cb6..a808765c 100644
--- a/pyqtgraph/canvas/CanvasItem.py
+++ b/pyqtgraph/canvas/CanvasItem.py
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore, QtSvg, USE_PYSIDE
-from pyqtgraph.graphicsItems.ROI import ROI
-import pyqtgraph as pg
+from ..Qt import QtGui, QtCore, QtSvg, USE_PYSIDE
+from ..graphicsItems.ROI import ROI
+from .. import SRTTransform, ItemGroup
if USE_PYSIDE:
from . import TransformGuiTemplate_pyside as TransformGuiTemplate
else:
from . import TransformGuiTemplate_pyqt as TransformGuiTemplate
-from pyqtgraph import debug
+from .. import debug
class SelectBox(ROI):
def __init__(self, scalable=False, rotatable=True):
@@ -96,7 +96,7 @@ class CanvasItem(QtCore.QObject):
if 'transform' in self.opts:
self.baseTransform = self.opts['transform']
else:
- self.baseTransform = pg.SRTTransform()
+ self.baseTransform = SRTTransform()
if 'pos' in self.opts and self.opts['pos'] is not None:
self.baseTransform.translate(self.opts['pos'])
if 'angle' in self.opts and self.opts['angle'] is not None:
@@ -124,8 +124,8 @@ class CanvasItem(QtCore.QObject):
self.itemScale = QtGui.QGraphicsScale()
self._graphicsItem.setTransformations([self.itemRotation, self.itemScale])
- self.tempTransform = pg.SRTTransform() ## holds the additional transform that happens during a move - gets added to the userTransform when move is done.
- self.userTransform = pg.SRTTransform() ## stores the total transform of the object
+ self.tempTransform = SRTTransform() ## holds the additional transform that happens during a move - gets added to the userTransform when move is done.
+ self.userTransform = SRTTransform() ## stores the total transform of the object
self.resetUserTransform()
## now happens inside resetUserTransform -> selectBoxToItem
@@ -200,7 +200,7 @@ class CanvasItem(QtCore.QObject):
#flip = self.transformGui.mirrorImageCheck.isChecked()
#tr = self.userTransform.saveState()
- inv = pg.SRTTransform()
+ inv = SRTTransform()
inv.scale(-1, 1)
self.userTransform = self.userTransform * inv
self.updateTransform()
@@ -231,7 +231,7 @@ class CanvasItem(QtCore.QObject):
if not self.isMovable():
return
self.rotate(180.)
- # inv = pg.SRTTransform()
+ # inv = SRTTransform()
# inv.scale(-1, -1)
# self.userTransform = self.userTransform * inv #flip lr/ud
# s=self.updateTransform()
@@ -316,7 +316,7 @@ class CanvasItem(QtCore.QObject):
def resetTemporaryTransform(self):
- self.tempTransform = pg.SRTTransform() ## don't use Transform.reset()--this transform might be used elsewhere.
+ self.tempTransform = SRTTransform() ## don't use Transform.reset()--this transform might be used elsewhere.
self.updateTransform()
def transform(self):
@@ -368,7 +368,7 @@ class CanvasItem(QtCore.QObject):
try:
#self.userTranslate = pg.Point(tr['trans'])
#self.userRotate = tr['rot']
- self.userTransform = pg.SRTTransform(tr)
+ self.userTransform = SRTTransform(tr)
self.updateTransform()
self.selectBoxFromUser() ## move select box to match
@@ -377,7 +377,7 @@ class CanvasItem(QtCore.QObject):
except:
#self.userTranslate = pg.Point([0,0])
#self.userRotate = 0
- self.userTransform = pg.SRTTransform()
+ self.userTransform = SRTTransform()
debug.printExc("Failed to load transform:")
#print "set transform", self, self.userTranslate
@@ -504,6 +504,6 @@ class GroupCanvasItem(CanvasItem):
def __init__(self, **opts):
defOpts = {'movable': False, 'scalable': False}
defOpts.update(opts)
- item = pg.ItemGroup()
+ item = ItemGroup()
CanvasItem.__init__(self, item, **defOpts)
diff --git a/pyqtgraph/canvas/CanvasManager.py b/pyqtgraph/canvas/CanvasManager.py
index e89ec00f..28188039 100644
--- a/pyqtgraph/canvas/CanvasManager.py
+++ b/pyqtgraph/canvas/CanvasManager.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
if not hasattr(QtCore, 'Signal'):
QtCore.Signal = QtCore.pyqtSignal
import weakref
diff --git a/pyqtgraph/canvas/CanvasTemplate.ui b/pyqtgraph/canvas/CanvasTemplate.ui
index da032906..218cf48d 100644
--- a/pyqtgraph/canvas/CanvasTemplate.ui
+++ b/pyqtgraph/canvas/CanvasTemplate.ui
@@ -131,12 +131,12 @@
TreeWidget
QTreeWidget
- pyqtgraph.widgets.TreeWidget
+
GraphicsView
QGraphicsView
- pyqtgraph.widgets.GraphicsView
+
CanvasCombo
diff --git a/pyqtgraph/canvas/CanvasTemplate_pyqt.py b/pyqtgraph/canvas/CanvasTemplate_pyqt.py
index 4d1d8208..c809cb1d 100644
--- a/pyqtgraph/canvas/CanvasTemplate_pyqt.py
+++ b/pyqtgraph/canvas/CanvasTemplate_pyqt.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './canvas/CanvasTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/canvas/CanvasTemplate.ui'
#
-# Created: Sun Sep 9 14:41:30 2012
-# by: PyQt4 UI code generator 4.9.1
+# Created: Mon Dec 23 10:10:52 2013
+# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
- _fromUtf8 = lambda s: s
+ def _fromUtf8(s):
+ return s
+
+try:
+ _encoding = QtGui.QApplication.UnicodeUTF8
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig, _encoding)
+except AttributeError:
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
@@ -85,16 +94,16 @@ class Ui_Form(object):
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
- Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
- self.storeSvgBtn.setText(QtGui.QApplication.translate("Form", "Store SVG", None, QtGui.QApplication.UnicodeUTF8))
- self.storePngBtn.setText(QtGui.QApplication.translate("Form", "Store PNG", None, QtGui.QApplication.UnicodeUTF8))
- self.autoRangeBtn.setText(QtGui.QApplication.translate("Form", "Auto Range", None, QtGui.QApplication.UnicodeUTF8))
- self.redirectCheck.setToolTip(QtGui.QApplication.translate("Form", "Check to display all local items in a remote canvas.", None, QtGui.QApplication.UnicodeUTF8))
- self.redirectCheck.setText(QtGui.QApplication.translate("Form", "Redirect", None, QtGui.QApplication.UnicodeUTF8))
- self.resetTransformsBtn.setText(QtGui.QApplication.translate("Form", "Reset Transforms", None, QtGui.QApplication.UnicodeUTF8))
- self.mirrorSelectionBtn.setText(QtGui.QApplication.translate("Form", "Mirror Selection", None, QtGui.QApplication.UnicodeUTF8))
- self.reflectSelectionBtn.setText(QtGui.QApplication.translate("Form", "MirrorXY", None, QtGui.QApplication.UnicodeUTF8))
+ Form.setWindowTitle(_translate("Form", "Form", None))
+ self.storeSvgBtn.setText(_translate("Form", "Store SVG", None))
+ self.storePngBtn.setText(_translate("Form", "Store PNG", None))
+ self.autoRangeBtn.setText(_translate("Form", "Auto Range", None))
+ self.redirectCheck.setToolTip(_translate("Form", "Check to display all local items in a remote canvas.", None))
+ self.redirectCheck.setText(_translate("Form", "Redirect", None))
+ self.resetTransformsBtn.setText(_translate("Form", "Reset Transforms", None))
+ self.mirrorSelectionBtn.setText(_translate("Form", "Mirror Selection", None))
+ self.reflectSelectionBtn.setText(_translate("Form", "MirrorXY", None))
-from pyqtgraph.widgets.GraphicsView import GraphicsView
+from ..widgets.TreeWidget import TreeWidget
from CanvasManager import CanvasCombo
-from pyqtgraph.widgets.TreeWidget import TreeWidget
+from ..widgets.GraphicsView import GraphicsView
diff --git a/pyqtgraph/canvas/CanvasTemplate_pyside.py b/pyqtgraph/canvas/CanvasTemplate_pyside.py
index 12afdf25..56d1ff47 100644
--- a/pyqtgraph/canvas/CanvasTemplate_pyside.py
+++ b/pyqtgraph/canvas/CanvasTemplate_pyside.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './canvas/CanvasTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/canvas/CanvasTemplate.ui'
#
-# Created: Sun Sep 9 14:41:30 2012
-# by: pyside-uic 0.2.13 running on PySide 1.1.0
+# Created: Mon Dec 23 10:10:52 2013
+# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
@@ -90,6 +90,6 @@ class Ui_Form(object):
self.mirrorSelectionBtn.setText(QtGui.QApplication.translate("Form", "Mirror Selection", None, QtGui.QApplication.UnicodeUTF8))
self.reflectSelectionBtn.setText(QtGui.QApplication.translate("Form", "MirrorXY", None, QtGui.QApplication.UnicodeUTF8))
-from pyqtgraph.widgets.GraphicsView import GraphicsView
+from ..widgets.TreeWidget import TreeWidget
from CanvasManager import CanvasCombo
-from pyqtgraph.widgets.TreeWidget import TreeWidget
+from ..widgets.GraphicsView import GraphicsView
diff --git a/pyqtgraph/canvas/TransformGuiTemplate_pyqt.py b/pyqtgraph/canvas/TransformGuiTemplate_pyqt.py
index 1fb86d24..75c694c0 100644
--- a/pyqtgraph/canvas/TransformGuiTemplate_pyqt.py
+++ b/pyqtgraph/canvas/TransformGuiTemplate_pyqt.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './canvas/TransformGuiTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/canvas/TransformGuiTemplate.ui'
#
-# Created: Sun Sep 9 14:41:30 2012
-# by: PyQt4 UI code generator 4.9.1
+# Created: Mon Dec 23 10:10:52 2013
+# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
- _fromUtf8 = lambda s: s
+ def _fromUtf8(s):
+ return s
+
+try:
+ _encoding = QtGui.QApplication.UnicodeUTF8
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig, _encoding)
+except AttributeError:
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
@@ -51,10 +60,10 @@ class Ui_Form(object):
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
- Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
- self.translateLabel.setText(QtGui.QApplication.translate("Form", "Translate:", None, QtGui.QApplication.UnicodeUTF8))
- self.rotateLabel.setText(QtGui.QApplication.translate("Form", "Rotate:", None, QtGui.QApplication.UnicodeUTF8))
- self.scaleLabel.setText(QtGui.QApplication.translate("Form", "Scale:", None, QtGui.QApplication.UnicodeUTF8))
- self.mirrorImageBtn.setText(QtGui.QApplication.translate("Form", "Mirror", None, QtGui.QApplication.UnicodeUTF8))
- self.reflectImageBtn.setText(QtGui.QApplication.translate("Form", "Reflect", None, QtGui.QApplication.UnicodeUTF8))
+ Form.setWindowTitle(_translate("Form", "Form", None))
+ self.translateLabel.setText(_translate("Form", "Translate:", None))
+ self.rotateLabel.setText(_translate("Form", "Rotate:", None))
+ self.scaleLabel.setText(_translate("Form", "Scale:", None))
+ self.mirrorImageBtn.setText(_translate("Form", "Mirror", None))
+ self.reflectImageBtn.setText(_translate("Form", "Reflect", None))
diff --git a/pyqtgraph/canvas/TransformGuiTemplate_pyside.py b/pyqtgraph/canvas/TransformGuiTemplate_pyside.py
index 47b23faa..bce7b511 100644
--- a/pyqtgraph/canvas/TransformGuiTemplate_pyside.py
+++ b/pyqtgraph/canvas/TransformGuiTemplate_pyside.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './canvas/TransformGuiTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/canvas/TransformGuiTemplate.ui'
#
-# Created: Sun Sep 9 14:41:30 2012
-# by: pyside-uic 0.2.13 running on PySide 1.1.0
+# Created: Mon Dec 23 10:10:52 2013
+# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
diff --git a/pyqtgraph/colormap.py b/pyqtgraph/colormap.py
index d6169209..cb1e882e 100644
--- a/pyqtgraph/colormap.py
+++ b/pyqtgraph/colormap.py
@@ -1,6 +1,6 @@
import numpy as np
import scipy.interpolate
-from pyqtgraph.Qt import QtGui, QtCore
+from .Qt import QtGui, QtCore
class ColorMap(object):
"""
diff --git a/pyqtgraph/console/CmdInput.py b/pyqtgraph/console/CmdInput.py
index 3e9730d6..24a01e89 100644
--- a/pyqtgraph/console/CmdInput.py
+++ b/pyqtgraph/console/CmdInput.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtCore, QtGui
-from pyqtgraph.python2_3 import asUnicode
+from ..Qt import QtCore, QtGui
+from ..python2_3 import asUnicode
class CmdInput(QtGui.QLineEdit):
diff --git a/pyqtgraph/console/Console.py b/pyqtgraph/console/Console.py
index 982c2424..0cbd2c3e 100644
--- a/pyqtgraph/console/Console.py
+++ b/pyqtgraph/console/Console.py
@@ -1,14 +1,14 @@
-from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE
+from ..Qt import QtCore, QtGui, USE_PYSIDE
import sys, re, os, time, traceback, subprocess
-import pyqtgraph as pg
if USE_PYSIDE:
from . import template_pyside as template
else:
from . import template_pyqt as template
-import pyqtgraph.exceptionHandling as exceptionHandling
+from .. import exceptionHandling as exceptionHandling
import pickle
+from .. import getConfigOption
class ConsoleWidget(QtGui.QWidget):
"""
@@ -281,7 +281,7 @@ class ConsoleWidget(QtGui.QWidget):
def stackItemDblClicked(self, item):
editor = self.editor
if editor is None:
- editor = pg.getConfigOption('editorCommand')
+ editor = getConfigOption('editorCommand')
if editor is None:
return
tb = self.currentFrame()
diff --git a/pyqtgraph/console/template_pyqt.py b/pyqtgraph/console/template_pyqt.py
index 89ee6cff..e0852c93 100644
--- a/pyqtgraph/console/template_pyqt.py
+++ b/pyqtgraph/console/template_pyqt.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './console/template.ui'
+# Form implementation generated from reading ui file './pyqtgraph/console/template.ui'
#
-# Created: Sun Sep 9 14:41:30 2012
-# by: PyQt4 UI code generator 4.9.1
+# Created: Mon Dec 23 10:10:53 2013
+# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
- _fromUtf8 = lambda s: s
+ def _fromUtf8(s):
+ return s
+
+try:
+ _encoding = QtGui.QApplication.UnicodeUTF8
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig, _encoding)
+except AttributeError:
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
@@ -97,15 +106,15 @@ class Ui_Form(object):
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
- Form.setWindowTitle(QtGui.QApplication.translate("Form", "Console", None, QtGui.QApplication.UnicodeUTF8))
- self.historyBtn.setText(QtGui.QApplication.translate("Form", "History..", None, QtGui.QApplication.UnicodeUTF8))
- self.exceptionBtn.setText(QtGui.QApplication.translate("Form", "Exceptions..", None, QtGui.QApplication.UnicodeUTF8))
- self.exceptionGroup.setTitle(QtGui.QApplication.translate("Form", "Exception Handling", None, QtGui.QApplication.UnicodeUTF8))
- self.catchAllExceptionsBtn.setText(QtGui.QApplication.translate("Form", "Show All Exceptions", None, QtGui.QApplication.UnicodeUTF8))
- self.catchNextExceptionBtn.setText(QtGui.QApplication.translate("Form", "Show Next Exception", None, QtGui.QApplication.UnicodeUTF8))
- self.onlyUncaughtCheck.setText(QtGui.QApplication.translate("Form", "Only Uncaught Exceptions", None, QtGui.QApplication.UnicodeUTF8))
- self.runSelectedFrameCheck.setText(QtGui.QApplication.translate("Form", "Run commands in selected stack frame", None, QtGui.QApplication.UnicodeUTF8))
- self.exceptionInfoLabel.setText(QtGui.QApplication.translate("Form", "Exception Info", None, QtGui.QApplication.UnicodeUTF8))
- self.clearExceptionBtn.setText(QtGui.QApplication.translate("Form", "Clear Exception", None, QtGui.QApplication.UnicodeUTF8))
+ Form.setWindowTitle(_translate("Form", "Console", None))
+ self.historyBtn.setText(_translate("Form", "History..", None))
+ self.exceptionBtn.setText(_translate("Form", "Exceptions..", None))
+ self.exceptionGroup.setTitle(_translate("Form", "Exception Handling", None))
+ self.catchAllExceptionsBtn.setText(_translate("Form", "Show All Exceptions", None))
+ self.catchNextExceptionBtn.setText(_translate("Form", "Show Next Exception", None))
+ self.onlyUncaughtCheck.setText(_translate("Form", "Only Uncaught Exceptions", None))
+ self.runSelectedFrameCheck.setText(_translate("Form", "Run commands in selected stack frame", None))
+ self.exceptionInfoLabel.setText(_translate("Form", "Exception Info", None))
+ self.clearExceptionBtn.setText(_translate("Form", "Clear Exception", None))
from .CmdInput import CmdInput
diff --git a/pyqtgraph/console/template_pyside.py b/pyqtgraph/console/template_pyside.py
index 0493a0fe..2db8ed95 100644
--- a/pyqtgraph/console/template_pyside.py
+++ b/pyqtgraph/console/template_pyside.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './console/template.ui'
+# Form implementation generated from reading ui file './pyqtgraph/console/template.ui'
#
-# Created: Sun Sep 9 14:41:30 2012
-# by: pyside-uic 0.2.13 running on PySide 1.1.0
+# Created: Mon Dec 23 10:10:53 2013
+# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
diff --git a/pyqtgraph/dockarea/Container.py b/pyqtgraph/dockarea/Container.py
index 01ae51d3..277375f3 100644
--- a/pyqtgraph/dockarea/Container.py
+++ b/pyqtgraph/dockarea/Container.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
import weakref
class Container(object):
diff --git a/pyqtgraph/dockarea/Dock.py b/pyqtgraph/dockarea/Dock.py
index 09a97813..f83397c7 100644
--- a/pyqtgraph/dockarea/Dock.py
+++ b/pyqtgraph/dockarea/Dock.py
@@ -1,7 +1,7 @@
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
from .DockDrop import *
-from pyqtgraph.widgets.VerticalLabel import VerticalLabel
+from ..widgets.VerticalLabel import VerticalLabel
class Dock(QtGui.QWidget, DockDrop):
diff --git a/pyqtgraph/dockarea/DockArea.py b/pyqtgraph/dockarea/DockArea.py
index 882b29a3..5c367f0b 100644
--- a/pyqtgraph/dockarea/DockArea.py
+++ b/pyqtgraph/dockarea/DockArea.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
from .Container import *
from .DockDrop import *
from .Dock import Dock
-import pyqtgraph.debug as debug
+from .. import debug as debug
import weakref
## TODO:
diff --git a/pyqtgraph/dockarea/DockDrop.py b/pyqtgraph/dockarea/DockDrop.py
index acab28cd..bd364f50 100644
--- a/pyqtgraph/dockarea/DockDrop.py
+++ b/pyqtgraph/dockarea/DockDrop.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
class DockDrop(object):
"""Provides dock-dropping methods"""
diff --git a/pyqtgraph/exporters/CSVExporter.py b/pyqtgraph/exporters/CSVExporter.py
index c6386655..b0cf5af5 100644
--- a/pyqtgraph/exporters/CSVExporter.py
+++ b/pyqtgraph/exporters/CSVExporter.py
@@ -1,8 +1,7 @@
-import pyqtgraph as pg
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .Exporter import Exporter
-from pyqtgraph.parametertree import Parameter
-
+from ..parametertree import Parameter
+from .. import PlotItem
__all__ = ['CSVExporter']
@@ -22,7 +21,7 @@ class CSVExporter(Exporter):
def export(self, fileName=None):
- if not isinstance(self.item, pg.PlotItem):
+ if not isinstance(self.item, PlotItem):
raise Exception("Must have a PlotItem selected for CSV export.")
if fileName is None:
diff --git a/pyqtgraph/exporters/Exporter.py b/pyqtgraph/exporters/Exporter.py
index 281fbb9a..64a25294 100644
--- a/pyqtgraph/exporters/Exporter.py
+++ b/pyqtgraph/exporters/Exporter.py
@@ -1,7 +1,7 @@
-from pyqtgraph.widgets.FileDialog import FileDialog
-import pyqtgraph as pg
-from pyqtgraph.Qt import QtGui, QtCore, QtSvg
-from pyqtgraph.python2_3 import asUnicode
+from ..widgets.FileDialog import FileDialog
+from ..Qt import QtGui, QtCore, QtSvg
+from ..python2_3 import asUnicode
+from ..GraphicsScene import GraphicsScene
import os, re
LastExportDirectory = None
@@ -77,20 +77,20 @@ class Exporter(object):
self.export(fileName=fileName, **self.fileDialog.opts)
def getScene(self):
- if isinstance(self.item, pg.GraphicsScene):
+ if isinstance(self.item, GraphicsScene):
return self.item
else:
return self.item.scene()
def getSourceRect(self):
- if isinstance(self.item, pg.GraphicsScene):
+ if isinstance(self.item, GraphicsScene):
w = self.item.getViewWidget()
return w.viewportTransform().inverted()[0].mapRect(w.rect())
else:
return self.item.sceneBoundingRect()
def getTargetRect(self):
- if isinstance(self.item, pg.GraphicsScene):
+ if isinstance(self.item, GraphicsScene):
return self.item.getViewWidget().rect()
else:
return self.item.mapRectToDevice(self.item.boundingRect())
diff --git a/pyqtgraph/exporters/ImageExporter.py b/pyqtgraph/exporters/ImageExporter.py
index 40a76fbd..c8abb02b 100644
--- a/pyqtgraph/exporters/ImageExporter.py
+++ b/pyqtgraph/exporters/ImageExporter.py
@@ -1,7 +1,7 @@
from .Exporter import Exporter
-from pyqtgraph.parametertree import Parameter
-from pyqtgraph.Qt import QtGui, QtCore, QtSvg, USE_PYSIDE
-import pyqtgraph as pg
+from ..parametertree import Parameter
+from ..Qt import QtGui, QtCore, QtSvg, USE_PYSIDE\
+from .. import functions as fn
import numpy as np
__all__ = ['ImageExporter']
@@ -73,7 +73,7 @@ class ImageExporter(Exporter):
bg[:,:,1] = color.green()
bg[:,:,2] = color.red()
bg[:,:,3] = color.alpha()
- self.png = pg.makeQImage(bg, alpha=True)
+ self.png = fn.makeQImage(bg, alpha=True)
## set resolution of image:
origTargetRect = self.getTargetRect()
diff --git a/pyqtgraph/exporters/Matplotlib.py b/pyqtgraph/exporters/Matplotlib.py
index 42008468..c2980b49 100644
--- a/pyqtgraph/exporters/Matplotlib.py
+++ b/pyqtgraph/exporters/Matplotlib.py
@@ -1,7 +1,7 @@
-import pyqtgraph as pg
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .Exporter import Exporter
-
+from .. import PlotItem
+from .. import functions as fn
__all__ = ['MatplotlibExporter']
@@ -17,7 +17,7 @@ class MatplotlibExporter(Exporter):
def export(self, fileName=None):
- if isinstance(self.item, pg.PlotItem):
+ if isinstance(self.item, PlotItem):
mpw = MatplotlibWindow()
MatplotlibExporter.windows.append(mpw)
fig = mpw.getFigure()
@@ -29,23 +29,23 @@ class MatplotlibExporter(Exporter):
for item in self.item.curves:
x, y = item.getData()
opts = item.opts
- pen = pg.mkPen(opts['pen'])
+ pen = fn.mkPen(opts['pen'])
if pen.style() == QtCore.Qt.NoPen:
linestyle = ''
else:
linestyle = '-'
- color = tuple([c/255. for c in pg.colorTuple(pen.color())])
+ color = tuple([c/255. for c in fn.colorTuple(pen.color())])
symbol = opts['symbol']
if symbol == 't':
symbol = '^'
- symbolPen = pg.mkPen(opts['symbolPen'])
- symbolBrush = pg.mkBrush(opts['symbolBrush'])
- markeredgecolor = tuple([c/255. for c in pg.colorTuple(symbolPen.color())])
- markerfacecolor = tuple([c/255. for c in pg.colorTuple(symbolBrush.color())])
+ symbolPen = fn.mkPen(opts['symbolPen'])
+ symbolBrush = fn.mkBrush(opts['symbolBrush'])
+ markeredgecolor = tuple([c/255. for c in fn.colorTuple(symbolPen.color())])
+ markerfacecolor = tuple([c/255. for c in fn.colorTuple(symbolBrush.color())])
if opts['fillLevel'] is not None and opts['fillBrush'] is not None:
- fillBrush = pg.mkBrush(opts['fillBrush'])
- fillcolor = tuple([c/255. for c in pg.colorTuple(fillBrush.color())])
+ fillBrush = fn.mkBrush(opts['fillBrush'])
+ fillcolor = tuple([c/255. for c in fn.colorTuple(fillBrush.color())])
ax.fill_between(x=x, y1=y, y2=opts['fillLevel'], facecolor=fillcolor)
ax.plot(x, y, marker=symbol, color=color, linewidth=pen.width(), linestyle=linestyle, markeredgecolor=markeredgecolor, markerfacecolor=markerfacecolor)
@@ -62,7 +62,7 @@ MatplotlibExporter.register()
class MatplotlibWindow(QtGui.QMainWindow):
def __init__(self):
- import pyqtgraph.widgets.MatplotlibWidget
+ from .. import widgets.MatplotlibWidget
QtGui.QMainWindow.__init__(self)
self.mpl = pyqtgraph.widgets.MatplotlibWidget.MatplotlibWidget()
self.setCentralWidget(self.mpl)
diff --git a/pyqtgraph/exporters/PrintExporter.py b/pyqtgraph/exporters/PrintExporter.py
index ef35c2f8..3e2d45fa 100644
--- a/pyqtgraph/exporters/PrintExporter.py
+++ b/pyqtgraph/exporters/PrintExporter.py
@@ -1,6 +1,6 @@
from .Exporter import Exporter
-from pyqtgraph.parametertree import Parameter
-from pyqtgraph.Qt import QtGui, QtCore, QtSvg
+from ..parametertree import Parameter
+from ..Qt import QtGui, QtCore, QtSvg
import re
__all__ = ['PrintExporter']
diff --git a/pyqtgraph/exporters/SVGExporter.py b/pyqtgraph/exporters/SVGExporter.py
index 425f48e9..4a02965b 100644
--- a/pyqtgraph/exporters/SVGExporter.py
+++ b/pyqtgraph/exporters/SVGExporter.py
@@ -1,8 +1,9 @@
from .Exporter import Exporter
-from pyqtgraph.python2_3 import asUnicode
-from pyqtgraph.parametertree import Parameter
-from pyqtgraph.Qt import QtGui, QtCore, QtSvg
-import pyqtgraph as pg
+from ..python2_3 import asUnicode
+from ..parametertree import Parameter
+from ..Qt import QtGui, QtCore, QtSvg
+from .. import debug
+from .. import functions as fn
import re
import xml.dom.minidom as xml
import numpy as np
@@ -156,7 +157,7 @@ def _generateItemSvg(item, nodes=None, root=None):
##
## Both 2 and 3 can be addressed by drawing all items in world coordinates.
- profiler = pg.debug.Profiler()
+ profiler = debug.Profiler()
if nodes is None: ## nodes maps all node IDs to their XML element.
## this allows us to ensure all elements receive unique names.
@@ -196,17 +197,12 @@ def _generateItemSvg(item, nodes=None, root=None):
tr2 = QtGui.QTransform()
tr2.translate(-rootPos.x(), -rootPos.y())
tr = tr * tr2
- #print item, pg.SRTTransform(tr)
- #tr.translate(item.pos().x(), item.pos().y())
- #tr = tr * item.transform()
arr = QtCore.QByteArray()
buf = QtCore.QBuffer(arr)
svg = QtSvg.QSvgGenerator()
svg.setOutputDevice(buf)
dpi = QtGui.QDesktopWidget().physicalDpiX()
- ### not really sure why this works, but it seems to be important:
- #self.svg.setSize(QtCore.QSize(self.params['width']*dpi/90., self.params['height']*dpi/90.))
svg.setResolution(dpi)
p = QtGui.QPainter()
@@ -350,7 +346,7 @@ def correctCoordinates(node, item):
if ch.tagName == 'polyline':
removeTransform = True
coords = np.array([[float(a) for a in c.split(',')] for c in ch.getAttribute('points').strip().split(' ')])
- coords = pg.transformCoordinates(tr, coords, transpose=True)
+ coords = fn.transformCoordinates(tr, coords, transpose=True)
ch.setAttribute('points', ' '.join([','.join([str(a) for a in c]) for c in coords]))
elif ch.tagName == 'path':
removeTransform = True
@@ -365,7 +361,7 @@ def correctCoordinates(node, item):
x = x[1:]
else:
t = ''
- nc = pg.transformCoordinates(tr, np.array([[float(x),float(y)]]), transpose=True)
+ nc = fn.transformCoordinates(tr, np.array([[float(x),float(y)]]), transpose=True)
newCoords += t+str(nc[0,0])+','+str(nc[0,1])+' '
ch.setAttribute('d', newCoords)
elif ch.tagName == 'text':
@@ -375,7 +371,7 @@ def correctCoordinates(node, item):
#[float(ch.getAttribute('x')), float(ch.getAttribute('y'))],
#[float(ch.getAttribute('font-size')), 0],
#[0,0]])
- #c = pg.transformCoordinates(tr, c, transpose=True)
+ #c = fn.transformCoordinates(tr, c, transpose=True)
#ch.setAttribute('x', str(c[0,0]))
#ch.setAttribute('y', str(c[0,1]))
#fs = c[1]-c[2]
@@ -397,7 +393,7 @@ def correctCoordinates(node, item):
## correct line widths if needed
if removeTransform and ch.getAttribute('vector-effect') != 'non-scaling-stroke':
w = float(grp.getAttribute('stroke-width'))
- s = pg.transformCoordinates(tr, np.array([[w,0], [0,0]]), transpose=True)
+ s = fn.transformCoordinates(tr, np.array([[w,0], [0,0]]), transpose=True)
w = ((s[0]-s[1])**2).sum()**0.5
ch.setAttribute('stroke-width', str(w))
@@ -443,35 +439,9 @@ def itemTransform(item, root):
tr = item.sceneTransform()
else:
tr = itemTransform(nextRoot, root) * item.itemTransform(nextRoot)[0]
- #pos = QtGui.QTransform()
- #pos.translate(root.pos().x(), root.pos().y())
- #tr = pos * root.transform() * item.itemTransform(root)[0]
-
return tr
-
-#def correctStroke(node, item, root, width=1):
- ##print "==============", item, node
- #if node.hasAttribute('stroke-width'):
- #width = float(node.getAttribute('stroke-width'))
- #if node.getAttribute('vector-effect') == 'non-scaling-stroke':
- #node.removeAttribute('vector-effect')
- #if isinstance(root, QtGui.QGraphicsScene):
- #w = item.mapFromScene(pg.Point(width,0))
- #o = item.mapFromScene(pg.Point(0,0))
- #else:
- #w = item.mapFromItem(root, pg.Point(width,0))
- #o = item.mapFromItem(root, pg.Point(0,0))
- #w = w-o
- ##print " ", w, o, w-o
- #w = (w.x()**2 + w.y()**2) ** 0.5
- ##print " ", w
- #node.setAttribute('stroke-width', str(w))
-
- #for ch in node.childNodes:
- #if isinstance(ch, xml.Element):
- #correctStroke(ch, item, root, width)
def cleanXml(node):
## remove extraneous text; let the xml library do the formatting.
diff --git a/pyqtgraph/exporters/__init__.py b/pyqtgraph/exporters/__init__.py
index e2a81bc2..8be1c3b6 100644
--- a/pyqtgraph/exporters/__init__.py
+++ b/pyqtgraph/exporters/__init__.py
@@ -1,16 +1,3 @@
-#Exporters = []
-#from pyqtgraph import importModules
-#import os
-#d = os.path.split(__file__)[0]
-#for mod in importModules('', globals(), locals(), excludes=['Exporter']).values():
- #if hasattr(mod, '__all__'):
- #names = mod.__all__
- #else:
- #names = [n for n in dir(mod) if n[0] != '_']
- #for k in names:
- #if hasattr(mod, k):
- #Exporters.append(getattr(mod, k))
-
from .Exporter import Exporter
from .ImageExporter import *
from .SVGExporter import *
diff --git a/pyqtgraph/flowchart/Flowchart.py b/pyqtgraph/flowchart/Flowchart.py
index f566e97c..8d1ea4ce 100644
--- a/pyqtgraph/flowchart/Flowchart.py
+++ b/pyqtgraph/flowchart/Flowchart.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE
+from ..Qt import QtCore, QtGui, USE_PYSIDE
from .Node import *
-from pyqtgraph.pgcollections import OrderedDict
-from pyqtgraph.widgets.TreeWidget import *
+from ..pgcollections import OrderedDict
+from ..widgets.TreeWidget import *
+from .. import FileDialog, DataTreeWidget
## pyside and pyqt use incompatible ui files.
if USE_PYSIDE:
@@ -15,10 +16,9 @@ else:
from .Terminal import Terminal
from numpy import ndarray
from .library import LIBRARY
-from pyqtgraph.debug import printExc
-import pyqtgraph.configfile as configfile
-import pyqtgraph.dockarea as dockarea
-import pyqtgraph as pg
+from ..debug import printExc
+from .. import configfile as configfile
+from .. import dockarea as dockarea
from . import FlowchartGraphicsView
def strDict(d):
@@ -537,7 +537,7 @@ class Flowchart(Node):
startDir = self.filePath
if startDir is None:
startDir = '.'
- self.fileDialog = pg.FileDialog(None, "Load Flowchart..", startDir, "Flowchart (*.fc)")
+ self.fileDialog = FileDialog(None, "Load Flowchart..", startDir, "Flowchart (*.fc)")
#self.fileDialog.setFileMode(QtGui.QFileDialog.AnyFile)
#self.fileDialog.setAcceptMode(QtGui.QFileDialog.AcceptSave)
self.fileDialog.show()
@@ -558,7 +558,7 @@ class Flowchart(Node):
startDir = self.filePath
if startDir is None:
startDir = '.'
- self.fileDialog = pg.FileDialog(None, "Save Flowchart..", startDir, "Flowchart (*.fc)")
+ self.fileDialog = FileDialog(None, "Save Flowchart..", startDir, "Flowchart (*.fc)")
#self.fileDialog.setFileMode(QtGui.QFileDialog.AnyFile)
self.fileDialog.setAcceptMode(QtGui.QFileDialog.AcceptSave)
#self.fileDialog.setDirectory(startDir)
@@ -821,7 +821,7 @@ class FlowchartWidget(dockarea.DockArea):
self.selDescLabel = QtGui.QLabel()
self.selNameLabel = QtGui.QLabel()
self.selDescLabel.setWordWrap(True)
- self.selectedTree = pg.DataTreeWidget()
+ self.selectedTree = DataTreeWidget()
#self.selectedTree.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
#self.selInfoLayout.addWidget(self.selNameLabel)
self.selInfoLayout.addWidget(self.selDescLabel)
diff --git a/pyqtgraph/flowchart/FlowchartCtrlTemplate.ui b/pyqtgraph/flowchart/FlowchartCtrlTemplate.ui
index 610846b6..0361ad3e 100644
--- a/pyqtgraph/flowchart/FlowchartCtrlTemplate.ui
+++ b/pyqtgraph/flowchart/FlowchartCtrlTemplate.ui
@@ -107,12 +107,12 @@
TreeWidget
QTreeWidget
- pyqtgraph.widgets.TreeWidget
+
FeedbackButton
QPushButton
- pyqtgraph.widgets.FeedbackButton
+
diff --git a/pyqtgraph/flowchart/FlowchartCtrlTemplate_pyqt.py b/pyqtgraph/flowchart/FlowchartCtrlTemplate_pyqt.py
index 0410cdf3..8afd43f8 100644
--- a/pyqtgraph/flowchart/FlowchartCtrlTemplate_pyqt.py
+++ b/pyqtgraph/flowchart/FlowchartCtrlTemplate_pyqt.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './flowchart/FlowchartCtrlTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/flowchart/FlowchartCtrlTemplate.ui'
#
-# Created: Sun Sep 9 14:41:30 2012
-# by: PyQt4 UI code generator 4.9.1
+# Created: Mon Dec 23 10:10:50 2013
+# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
- _fromUtf8 = lambda s: s
+ def _fromUtf8(s):
+ return s
+
+try:
+ _encoding = QtGui.QApplication.UnicodeUTF8
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig, _encoding)
+except AttributeError:
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
@@ -60,12 +69,12 @@ class Ui_Form(object):
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
- Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
- self.loadBtn.setText(QtGui.QApplication.translate("Form", "Load..", None, QtGui.QApplication.UnicodeUTF8))
- self.saveBtn.setText(QtGui.QApplication.translate("Form", "Save", None, QtGui.QApplication.UnicodeUTF8))
- self.saveAsBtn.setText(QtGui.QApplication.translate("Form", "As..", None, QtGui.QApplication.UnicodeUTF8))
- self.reloadBtn.setText(QtGui.QApplication.translate("Form", "Reload Libs", None, QtGui.QApplication.UnicodeUTF8))
- self.showChartBtn.setText(QtGui.QApplication.translate("Form", "Flowchart", None, QtGui.QApplication.UnicodeUTF8))
+ Form.setWindowTitle(_translate("Form", "Form", None))
+ self.loadBtn.setText(_translate("Form", "Load..", None))
+ self.saveBtn.setText(_translate("Form", "Save", None))
+ self.saveAsBtn.setText(_translate("Form", "As..", None))
+ self.reloadBtn.setText(_translate("Form", "Reload Libs", None))
+ self.showChartBtn.setText(_translate("Form", "Flowchart", None))
-from pyqtgraph.widgets.FeedbackButton import FeedbackButton
-from pyqtgraph.widgets.TreeWidget import TreeWidget
+from ..widgets.TreeWidget import TreeWidget
+from ..widgets.FeedbackButton import FeedbackButton
diff --git a/pyqtgraph/flowchart/FlowchartCtrlTemplate_pyside.py b/pyqtgraph/flowchart/FlowchartCtrlTemplate_pyside.py
index f579c957..b722000e 100644
--- a/pyqtgraph/flowchart/FlowchartCtrlTemplate_pyside.py
+++ b/pyqtgraph/flowchart/FlowchartCtrlTemplate_pyside.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './flowchart/FlowchartCtrlTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/flowchart/FlowchartCtrlTemplate.ui'
#
-# Created: Sun Sep 9 14:41:30 2012
-# by: pyside-uic 0.2.13 running on PySide 1.1.0
+# Created: Mon Dec 23 10:10:51 2013
+# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
@@ -62,5 +62,5 @@ class Ui_Form(object):
self.reloadBtn.setText(QtGui.QApplication.translate("Form", "Reload Libs", None, QtGui.QApplication.UnicodeUTF8))
self.showChartBtn.setText(QtGui.QApplication.translate("Form", "Flowchart", None, QtGui.QApplication.UnicodeUTF8))
-from pyqtgraph.widgets.FeedbackButton import FeedbackButton
-from pyqtgraph.widgets.TreeWidget import TreeWidget
+from ..widgets.TreeWidget import TreeWidget
+from ..widgets.FeedbackButton import FeedbackButton
diff --git a/pyqtgraph/flowchart/FlowchartGraphicsView.py b/pyqtgraph/flowchart/FlowchartGraphicsView.py
index 0ec4d5c8..ab4b2914 100644
--- a/pyqtgraph/flowchart/FlowchartGraphicsView.py
+++ b/pyqtgraph/flowchart/FlowchartGraphicsView.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.widgets.GraphicsView import GraphicsView
-from pyqtgraph.GraphicsScene import GraphicsScene
-from pyqtgraph.graphicsItems.ViewBox import ViewBox
+from ..Qt import QtGui, QtCore
+from ..widgets.GraphicsView import GraphicsView
+from ..GraphicsScene import GraphicsScene
+from ..graphicsItems.ViewBox import ViewBox
#class FlowchartGraphicsView(QtGui.QGraphicsView):
class FlowchartGraphicsView(GraphicsView):
diff --git a/pyqtgraph/flowchart/FlowchartTemplate.ui b/pyqtgraph/flowchart/FlowchartTemplate.ui
index 31b1359c..8b0c19da 100644
--- a/pyqtgraph/flowchart/FlowchartTemplate.ui
+++ b/pyqtgraph/flowchart/FlowchartTemplate.ui
@@ -85,12 +85,12 @@
DataTreeWidget
QTreeWidget
- pyqtgraph.widgets.DataTreeWidget
+
FlowchartGraphicsView
QGraphicsView
- pyqtgraph.flowchart.FlowchartGraphicsView
+ ..flowchart.FlowchartGraphicsView
diff --git a/pyqtgraph/flowchart/FlowchartTemplate_pyqt.py b/pyqtgraph/flowchart/FlowchartTemplate_pyqt.py
index c07dd734..06b10bfe 100644
--- a/pyqtgraph/flowchart/FlowchartTemplate_pyqt.py
+++ b/pyqtgraph/flowchart/FlowchartTemplate_pyqt.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './flowchart/FlowchartTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/flowchart/FlowchartTemplate.ui'
#
-# Created: Sun Feb 24 19:47:29 2013
-# by: PyQt4 UI code generator 4.9.3
+# Created: Mon Dec 23 10:10:51 2013
+# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
- _fromUtf8 = lambda s: s
+ def _fromUtf8(s):
+ return s
+
+try:
+ _encoding = QtGui.QApplication.UnicodeUTF8
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig, _encoding)
+except AttributeError:
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
@@ -53,7 +62,7 @@ class Ui_Form(object):
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
- Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
+ Form.setWindowTitle(_translate("Form", "Form", None))
-from pyqtgraph.widgets.DataTreeWidget import DataTreeWidget
-from pyqtgraph.flowchart.FlowchartGraphicsView import FlowchartGraphicsView
+from ..flowchart.FlowchartGraphicsView import FlowchartGraphicsView
+from ..widgets.DataTreeWidget import DataTreeWidget
diff --git a/pyqtgraph/flowchart/FlowchartTemplate_pyside.py b/pyqtgraph/flowchart/FlowchartTemplate_pyside.py
index c73f3c00..2c693c60 100644
--- a/pyqtgraph/flowchart/FlowchartTemplate_pyside.py
+++ b/pyqtgraph/flowchart/FlowchartTemplate_pyside.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './flowchart/FlowchartTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/flowchart/FlowchartTemplate.ui'
#
-# Created: Sun Feb 24 19:47:30 2013
-# by: pyside-uic 0.2.13 running on PySide 1.1.1
+# Created: Mon Dec 23 10:10:51 2013
+# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
@@ -50,5 +50,5 @@ class Ui_Form(object):
def retranslateUi(self, Form):
Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
-from pyqtgraph.widgets.DataTreeWidget import DataTreeWidget
-from pyqtgraph.flowchart.FlowchartGraphicsView import FlowchartGraphicsView
+from ..flowchart.FlowchartGraphicsView import FlowchartGraphicsView
+from ..widgets.DataTreeWidget import DataTreeWidget
diff --git a/pyqtgraph/flowchart/Node.py b/pyqtgraph/flowchart/Node.py
index f1de40d6..b6ed1e0f 100644
--- a/pyqtgraph/flowchart/Node.py
+++ b/pyqtgraph/flowchart/Node.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtCore, QtGui
-from pyqtgraph.graphicsItems.GraphicsObject import GraphicsObject
-import pyqtgraph.functions as fn
+from ..Qt import QtCore, QtGui
+from ..graphicsItems.GraphicsObject import GraphicsObject
+from .. import functions as fn
from .Terminal import *
-from pyqtgraph.pgcollections import OrderedDict
-from pyqtgraph.debug import *
+from ..pgcollections import OrderedDict
+from ..debug import *
import numpy as np
from .eq import *
diff --git a/pyqtgraph/flowchart/NodeLibrary.py b/pyqtgraph/flowchart/NodeLibrary.py
index 20d0085e..a30ffb2a 100644
--- a/pyqtgraph/flowchart/NodeLibrary.py
+++ b/pyqtgraph/flowchart/NodeLibrary.py
@@ -1,4 +1,4 @@
-from pyqtgraph.pgcollections import OrderedDict
+from ..pgcollections import OrderedDict
from .Node import Node
def isNodeClass(cls):
diff --git a/pyqtgraph/flowchart/Terminal.py b/pyqtgraph/flowchart/Terminal.py
index fea60dee..6a6db62e 100644
--- a/pyqtgraph/flowchart/Terminal.py
+++ b/pyqtgraph/flowchart/Terminal.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
import weakref
-from pyqtgraph.graphicsItems.GraphicsObject import GraphicsObject
-import pyqtgraph.functions as fn
-from pyqtgraph.Point import Point
+from ..graphicsItems.GraphicsObject import GraphicsObject
+from .. import functions as fn
+from ..Point import Point
#from PySide import QtCore, QtGui
from .eq import *
diff --git a/pyqtgraph/flowchart/eq.py b/pyqtgraph/flowchart/eq.py
index 031ebce8..89ebe09f 100644
--- a/pyqtgraph/flowchart/eq.py
+++ b/pyqtgraph/flowchart/eq.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from numpy import ndarray, bool_
-from pyqtgraph.metaarray import MetaArray
+from ..metaarray import MetaArray
def eq(a, b):
"""The great missing equivalence function: Guaranteed evaluation to a single bool value."""
diff --git a/pyqtgraph/flowchart/library/Data.py b/pyqtgraph/flowchart/library/Data.py
index cbef848a..52458bd9 100644
--- a/pyqtgraph/flowchart/library/Data.py
+++ b/pyqtgraph/flowchart/library/Data.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
from ..Node import Node
-from pyqtgraph.Qt import QtGui, QtCore
+from ...Qt import QtGui, QtCore
import numpy as np
from .common import *
-from pyqtgraph.SRTTransform import SRTTransform
-from pyqtgraph.Point import Point
-from pyqtgraph.widgets.TreeWidget import TreeWidget
-from pyqtgraph.graphicsItems.LinearRegionItem import LinearRegionItem
+from ...SRTTransform import SRTTransform
+from ...Point import Point
+from ...widgets.TreeWidget import TreeWidget
+from ...graphicsItems.LinearRegionItem import LinearRegionItem
from . import functions
diff --git a/pyqtgraph/flowchart/library/Display.py b/pyqtgraph/flowchart/library/Display.py
index 9068c0ec..2c352fb2 100644
--- a/pyqtgraph/flowchart/library/Display.py
+++ b/pyqtgraph/flowchart/library/Display.py
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
from ..Node import Node
import weakref
-#from pyqtgraph import graphicsItems
-from pyqtgraph.Qt import QtCore, QtGui
-from pyqtgraph.graphicsItems.ScatterPlotItem import ScatterPlotItem
-from pyqtgraph.graphicsItems.PlotCurveItem import PlotCurveItem
-from pyqtgraph import PlotDataItem
+from ...Qt import QtCore, QtGui
+from ...graphicsItems.ScatterPlotItem import ScatterPlotItem
+from ...graphicsItems.PlotCurveItem import PlotCurveItem
+from ... import PlotDataItem
from .common import *
import numpy as np
@@ -272,4 +271,4 @@ class ScatterPlot(CtrlNode):
#pos = file.
-
\ No newline at end of file
+
diff --git a/pyqtgraph/flowchart/library/Filters.py b/pyqtgraph/flowchart/library/Filters.py
index 090c261c..518c8c18 100644
--- a/pyqtgraph/flowchart/library/Filters.py
+++ b/pyqtgraph/flowchart/library/Filters.py
@@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtCore, QtGui
+from ...Qt import QtCore, QtGui
from ..Node import Node
from scipy.signal import detrend
from scipy.ndimage import median_filter, gaussian_filter
-#from pyqtgraph.SignalProxy import SignalProxy
+#from ...SignalProxy import SignalProxy
from . import functions
from .common import *
import numpy as np
-import pyqtgraph.metaarray as metaarray
+from ... import metaarray as metaarray
class Downsample(CtrlNode):
diff --git a/pyqtgraph/flowchart/library/__init__.py b/pyqtgraph/flowchart/library/__init__.py
index 32a17b58..d8038aa4 100644
--- a/pyqtgraph/flowchart/library/__init__.py
+++ b/pyqtgraph/flowchart/library/__init__.py
@@ -1,11 +1,9 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.pgcollections import OrderedDict
-#from pyqtgraph import importModules
+from ...pgcollections import OrderedDict
import os, types
-from pyqtgraph.debug import printExc
-#from ..Node import Node
+from ...debug import printExc
from ..NodeLibrary import NodeLibrary, isNodeClass
-import pyqtgraph.reload as reload
+from ... import reload as reload
# Build default library
@@ -21,82 +19,10 @@ getNodeType = LIBRARY.getNodeType
# Add all nodes to the default library
from . import Data, Display, Filters, Operators
for mod in [Data, Display, Filters, Operators]:
- #mod = getattr(__import__('', fromlist=[modName], level=1), modName)
- #mod = __import__(modName, level=1)
nodes = [getattr(mod, name) for name in dir(mod) if isNodeClass(getattr(mod, name))]
for node in nodes:
LIBRARY.addNodeType(node, [(mod.__name__.split('.')[-1],)])
-#NODE_LIST = OrderedDict() ## maps name:class for all registered Node subclasses
-#NODE_TREE = OrderedDict() ## categorized tree of Node subclasses
-
-#def getNodeType(name):
- #try:
- #return NODE_LIST[name]
- #except KeyError:
- #raise Exception("No node type called '%s'" % name)
-
-#def getNodeTree():
- #return NODE_TREE
-
-#def registerNodeType(cls, paths, override=False):
- #"""
- #Register a new node type. If the type's name is already in use,
- #an exception will be raised (unless override=True).
-
- #Arguments:
- #cls - a subclass of Node (must have typ.nodeName)
- #paths - list of tuples specifying the location(s) this
- #type will appear in the library tree.
- #override - if True, overwrite any class having the same name
- #"""
- #if not isNodeClass(cls):
- #raise Exception("Object %s is not a Node subclass" % str(cls))
-
- #name = cls.nodeName
- #if not override and name in NODE_LIST:
- #raise Exception("Node type name '%s' is already registered." % name)
-
- #NODE_LIST[name] = cls
- #for path in paths:
- #root = NODE_TREE
- #for n in path:
- #if n not in root:
- #root[n] = OrderedDict()
- #root = root[n]
- #root[name] = cls
-
-
-
-#def isNodeClass(cls):
- #try:
- #if not issubclass(cls, Node):
- #return False
- #except:
- #return False
- #return hasattr(cls, 'nodeName')
-
-#def loadLibrary(reloadLibs=False, libPath=None):
- #"""Import all Node subclasses found within files in the library module."""
-
- #global NODE_LIST, NODE_TREE
-
- #if reloadLibs:
- #reload.reloadAll(libPath)
-
- #mods = importModules('', globals(), locals())
-
- #for name, mod in mods.items():
- #nodes = []
- #for n in dir(mod):
- #o = getattr(mod, n)
- #if isNodeClass(o):
- #registerNodeType(o, [(name,)], override=reloadLibs)
-
-#def reloadLibrary():
- #loadLibrary(reloadLibs=True)
-
-#loadLibrary()
diff --git a/pyqtgraph/flowchart/library/common.py b/pyqtgraph/flowchart/library/common.py
index 65f8c1fd..548dc440 100644
--- a/pyqtgraph/flowchart/library/common.py
+++ b/pyqtgraph/flowchart/library/common.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtCore, QtGui
-from pyqtgraph.widgets.SpinBox import SpinBox
-#from pyqtgraph.SignalProxy import SignalProxy
-from pyqtgraph.WidgetGroup import WidgetGroup
+from ...Qt import QtCore, QtGui
+from ...widgets.SpinBox import SpinBox
+#from ...SignalProxy import SignalProxy
+from ...WidgetGroup import WidgetGroup
#from ColorMapper import ColorMapper
from ..Node import Node
import numpy as np
-from pyqtgraph.widgets.ColorButton import ColorButton
+from ...widgets.ColorButton import ColorButton
try:
import metaarray
HAVE_METAARRAY = True
diff --git a/pyqtgraph/flowchart/library/functions.py b/pyqtgraph/flowchart/library/functions.py
index 0476e02f..9efb8f36 100644
--- a/pyqtgraph/flowchart/library/functions.py
+++ b/pyqtgraph/flowchart/library/functions.py
@@ -1,6 +1,6 @@
import scipy
import numpy as np
-from pyqtgraph.metaarray import MetaArray
+from ...metaarray import MetaArray
def downsample(data, n, axis=0, xvals='subsample'):
"""Downsample by averaging points together across axis.
diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py
index 80e61404..12588cf1 100644
--- a/pyqtgraph/functions.py
+++ b/pyqtgraph/functions.py
@@ -24,7 +24,7 @@ SI_PREFIXES_ASCII = 'yzafpnum kMGTPEZY'
from .Qt import QtGui, QtCore, USE_PYSIDE
-import pyqtgraph as pg
+from . import getConfigOption, setConfigOptions
import numpy as np
import decimal, re
import ctypes
@@ -33,11 +33,11 @@ import sys, struct
try:
import scipy.ndimage
HAVE_SCIPY = True
- if pg.getConfigOption('useWeave'):
+ if getConfigOption('useWeave'):
try:
import scipy.weave
except ImportError:
- pg.setConfigOptions(useWeave=False)
+ setConfigOptions(useWeave=False)
except ImportError:
HAVE_SCIPY = False
@@ -620,7 +620,7 @@ def rescaleData(data, scale, offset, dtype=None):
dtype = np.dtype(dtype)
try:
- if not pg.getConfigOption('useWeave'):
+ if not getConfigOption('useWeave'):
raise Exception('Weave is disabled; falling back to slower version.')
## require native dtype when using weave
@@ -647,10 +647,10 @@ def rescaleData(data, scale, offset, dtype=None):
newData = newData.astype(dtype)
data = newData.reshape(data.shape)
except:
- if pg.getConfigOption('useWeave'):
- if pg.getConfigOption('weaveDebug'):
+ if getConfigOption('useWeave'):
+ if getConfigOption('weaveDebug'):
debug.printExc("Error; disabling weave.")
- pg.setConfigOption('useWeave', False)
+ setConfigOptions(useWeave=False)
#p = np.poly1d([scale, -offset*scale])
#data = p(data).astype(dtype)
diff --git a/pyqtgraph/graphicsItems/ArrowItem.py b/pyqtgraph/graphicsItems/ArrowItem.py
index dcede02a..b15fc664 100644
--- a/pyqtgraph/graphicsItems/ArrowItem.py
+++ b/pyqtgraph/graphicsItems/ArrowItem.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtGui, QtCore
-import pyqtgraph.functions as fn
+from ..Qt import QtGui, QtCore
+from .. import functions as fn
import numpy as np
__all__ = ['ArrowItem']
diff --git a/pyqtgraph/graphicsItems/AxisItem.py b/pyqtgraph/graphicsItems/AxisItem.py
index 3dd98cef..1d0b36b6 100644
--- a/pyqtgraph/graphicsItems/AxisItem.py
+++ b/pyqtgraph/graphicsItems/AxisItem.py
@@ -1,11 +1,11 @@
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.python2_3 import asUnicode
+from ..Qt import QtGui, QtCore
+from ..python2_3 import asUnicode
import numpy as np
-from pyqtgraph.Point import Point
-import pyqtgraph.debug as debug
+from ..Point import Point
+from .. import debug as debug
import weakref
-import pyqtgraph.functions as fn
-import pyqtgraph as pg
+from .. import functions as fn
+from .. import getConfigOption
from .GraphicsWidget import GraphicsWidget
__all__ = ['AxisItem']
@@ -268,8 +268,8 @@ class AxisItem(GraphicsWidget):
def pen(self):
if self._pen is None:
- return fn.mkPen(pg.getConfigOption('foreground'))
- return pg.mkPen(self._pen)
+ return fn.mkPen(getConfigOption('foreground'))
+ return fn.mkPen(self._pen)
def setPen(self, pen):
"""
@@ -280,8 +280,8 @@ class AxisItem(GraphicsWidget):
self._pen = pen
self.picture = None
if pen is None:
- pen = pg.getConfigOption('foreground')
- self.labelStyle['color'] = '#' + pg.colorStr(pg.mkPen(pen).color())[:6]
+ pen = getConfigOption('foreground')
+ self.labelStyle['color'] = '#' + fn.colorStr(fn.mkPen(pen).color())[:6]
self.setLabel()
self.update()
diff --git a/pyqtgraph/graphicsItems/BarGraphItem.py b/pyqtgraph/graphicsItems/BarGraphItem.py
index 0527e9f1..9f9dbcde 100644
--- a/pyqtgraph/graphicsItems/BarGraphItem.py
+++ b/pyqtgraph/graphicsItems/BarGraphItem.py
@@ -1,8 +1,10 @@
-import pyqtgraph as pg
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .GraphicsObject import GraphicsObject
+from .. import getConfigOption
+from .. import functions as fn
import numpy as np
+
__all__ = ['BarGraphItem']
class BarGraphItem(GraphicsObject):
@@ -61,7 +63,7 @@ class BarGraphItem(GraphicsObject):
pens = self.opts['pens']
if pen is None and pens is None:
- pen = pg.getConfigOption('foreground')
+ pen = getConfigOption('foreground')
brush = self.opts['brush']
brushes = self.opts['brushes']
@@ -112,13 +114,13 @@ class BarGraphItem(GraphicsObject):
raise Exception('must specify either y1 or height')
height = y1 - y0
- p.setPen(pg.mkPen(pen))
- p.setBrush(pg.mkBrush(brush))
+ p.setPen(fn.mkPen(pen))
+ p.setBrush(fn.mkBrush(brush))
for i in range(len(x0)):
if pens is not None:
- p.setPen(pg.mkPen(pens[i]))
+ p.setPen(fn.mkPen(pens[i]))
if brushes is not None:
- p.setBrush(pg.mkBrush(brushes[i]))
+ p.setBrush(fn.mkBrush(brushes[i]))
if np.isscalar(y0):
y = y0
diff --git a/pyqtgraph/graphicsItems/ButtonItem.py b/pyqtgraph/graphicsItems/ButtonItem.py
index 741f2666..1c796823 100644
--- a/pyqtgraph/graphicsItems/ButtonItem.py
+++ b/pyqtgraph/graphicsItems/ButtonItem.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .GraphicsObject import GraphicsObject
__all__ = ['ButtonItem']
diff --git a/pyqtgraph/graphicsItems/CurvePoint.py b/pyqtgraph/graphicsItems/CurvePoint.py
index 668830f7..f981bdf8 100644
--- a/pyqtgraph/graphicsItems/CurvePoint.py
+++ b/pyqtgraph/graphicsItems/CurvePoint.py
@@ -1,7 +1,7 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from . import ArrowItem
import numpy as np
-from pyqtgraph.Point import Point
+from ..Point import Point
import weakref
from .GraphicsObject import GraphicsObject
diff --git a/pyqtgraph/graphicsItems/ErrorBarItem.py b/pyqtgraph/graphicsItems/ErrorBarItem.py
index 656b9e2e..7b681389 100644
--- a/pyqtgraph/graphicsItems/ErrorBarItem.py
+++ b/pyqtgraph/graphicsItems/ErrorBarItem.py
@@ -1,6 +1,7 @@
-import pyqtgraph as pg
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .GraphicsObject import GraphicsObject
+from .. import getConfigOption
+from .. import functions as fn
__all__ = ['ErrorBarItem']
@@ -121,8 +122,8 @@ class ErrorBarItem(GraphicsObject):
self.drawPath()
pen = self.opts['pen']
if pen is None:
- pen = pg.getConfigOption('foreground')
- p.setPen(pg.mkPen(pen))
+ pen = getConfigOption('foreground')
+ p.setPen(fn.mkPen(pen))
p.drawPath(self.path)
def boundingRect(self):
diff --git a/pyqtgraph/graphicsItems/FillBetweenItem.py b/pyqtgraph/graphicsItems/FillBetweenItem.py
index e0011177..13e5fa6b 100644
--- a/pyqtgraph/graphicsItems/FillBetweenItem.py
+++ b/pyqtgraph/graphicsItems/FillBetweenItem.py
@@ -1,23 +1,24 @@
-import pyqtgraph as pg
+from ..Qt import QtGui
+from .. import functions as fn
-class FillBetweenItem(pg.QtGui.QGraphicsPathItem):
+class FillBetweenItem(QtGui.QGraphicsPathItem):
"""
GraphicsItem filling the space between two PlotDataItems.
"""
def __init__(self, p1, p2, brush=None):
- pg.QtGui.QGraphicsPathItem.__init__(self)
+ QtGui.QGraphicsPathItem.__init__(self)
self.p1 = p1
self.p2 = p2
p1.sigPlotChanged.connect(self.updatePath)
p2.sigPlotChanged.connect(self.updatePath)
if brush is not None:
- self.setBrush(pg.mkBrush(brush))
+ self.setBrush(fn.mkBrush(brush))
self.setZValue(min(p1.zValue(), p2.zValue())-1)
self.updatePath()
def updatePath(self):
p1 = self.p1.curve.path
p2 = self.p2.curve.path
- path = pg.QtGui.QPainterPath()
+ path = QtGui.QPainterPath()
path.addPolygon(p1.toSubpathPolygons()[0] + p2.toReversed().toSubpathPolygons()[0])
self.setPath(path)
diff --git a/pyqtgraph/graphicsItems/GradientEditorItem.py b/pyqtgraph/graphicsItems/GradientEditorItem.py
index 955106d8..f5158a74 100644
--- a/pyqtgraph/graphicsItems/GradientEditorItem.py
+++ b/pyqtgraph/graphicsItems/GradientEditorItem.py
@@ -1,11 +1,11 @@
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.python2_3 import sortList
-import pyqtgraph.functions as fn
+from ..Qt import QtGui, QtCore
+from ..python2_3 import sortList
+from .. import functions as fn
from .GraphicsObject import GraphicsObject
from .GraphicsWidget import GraphicsWidget
import weakref
-from pyqtgraph.pgcollections import OrderedDict
-from pyqtgraph.colormap import ColorMap
+from ..pgcollections import OrderedDict
+from ..colormap import ColorMap
import numpy as np
diff --git a/pyqtgraph/graphicsItems/GradientLegend.py b/pyqtgraph/graphicsItems/GradientLegend.py
index 4528b7ed..28c2cd63 100644
--- a/pyqtgraph/graphicsItems/GradientLegend.py
+++ b/pyqtgraph/graphicsItems/GradientLegend.py
@@ -1,6 +1,6 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .UIGraphicsItem import *
-import pyqtgraph.functions as fn
+from .. import functions as fn
__all__ = ['GradientLegend']
diff --git a/pyqtgraph/graphicsItems/GraphItem.py b/pyqtgraph/graphicsItems/GraphItem.py
index b1f34baa..97759522 100644
--- a/pyqtgraph/graphicsItems/GraphItem.py
+++ b/pyqtgraph/graphicsItems/GraphItem.py
@@ -1,8 +1,9 @@
from .. import functions as fn
from .GraphicsObject import GraphicsObject
from .ScatterPlotItem import ScatterPlotItem
-import pyqtgraph as pg
+from ..Qt import QtGui, QtCore
import numpy as np
+from .. import getConfigOption
__all__ = ['GraphItem']
@@ -71,11 +72,11 @@ class GraphItem(GraphicsObject):
self.picture = None
def generatePicture(self):
- self.picture = pg.QtGui.QPicture()
+ self.picture = QtGui.QPicture()
if self.pen is None or self.pos is None or self.adjacency is None:
return
- p = pg.QtGui.QPainter(self.picture)
+ p = QtGui.QPainter(self.picture)
try:
pts = self.pos[self.adjacency]
pen = self.pen
@@ -86,14 +87,14 @@ class GraphItem(GraphicsObject):
if np.any(pen != lastPen):
lastPen = pen
if pen.dtype.fields is None:
- p.setPen(pg.mkPen(color=(pen[0], pen[1], pen[2], pen[3]), width=1))
+ p.setPen(fn.mkPen(color=(pen[0], pen[1], pen[2], pen[3]), width=1))
else:
- p.setPen(pg.mkPen(color=(pen['red'], pen['green'], pen['blue'], pen['alpha']), width=pen['width']))
- p.drawLine(pg.QtCore.QPointF(*pts[i][0]), pg.QtCore.QPointF(*pts[i][1]))
+ p.setPen(fn.mkPen(color=(pen['red'], pen['green'], pen['blue'], pen['alpha']), width=pen['width']))
+ p.drawLine(QtCore.QPointF(*pts[i][0]), QtCore.QPointF(*pts[i][1]))
else:
if pen == 'default':
- pen = pg.getConfigOption('foreground')
- p.setPen(pg.mkPen(pen))
+ pen = getConfigOption('foreground')
+ p.setPen(fn.mkPen(pen))
pts = pts.reshape((pts.shape[0]*pts.shape[1], pts.shape[2]))
path = fn.arrayToQPath(x=pts[:,0], y=pts[:,1], connect='pairs')
p.drawPath(path)
@@ -103,7 +104,7 @@ class GraphItem(GraphicsObject):
def paint(self, p, *args):
if self.picture == None:
self.generatePicture()
- if pg.getConfigOption('antialias') is True:
+ if getConfigOption('antialias') is True:
p.setRenderHint(p.Antialiasing)
self.picture.play(p)
diff --git a/pyqtgraph/graphicsItems/GraphicsItem.py b/pyqtgraph/graphicsItems/GraphicsItem.py
index 19cddd8a..8d2238b8 100644
--- a/pyqtgraph/graphicsItems/GraphicsItem.py
+++ b/pyqtgraph/graphicsItems/GraphicsItem.py
@@ -1,9 +1,9 @@
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.GraphicsScene import GraphicsScene
-from pyqtgraph.Point import Point
-import pyqtgraph.functions as fn
+from ..Qt import QtGui, QtCore
+from ..GraphicsScene import GraphicsScene
+from ..Point import Point
+from .. import functions as fn
import weakref
-from pyqtgraph.pgcollections import OrderedDict
+from ..pgcollections import OrderedDict
import operator, sys
class FiniteCache(OrderedDict):
diff --git a/pyqtgraph/graphicsItems/GraphicsLayout.py b/pyqtgraph/graphicsItems/GraphicsLayout.py
index 9d48e627..a4016522 100644
--- a/pyqtgraph/graphicsItems/GraphicsLayout.py
+++ b/pyqtgraph/graphicsItems/GraphicsLayout.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtGui, QtCore
-import pyqtgraph.functions as fn
+from ..Qt import QtGui, QtCore
+from .. import functions as fn
from .GraphicsWidget import GraphicsWidget
## Must be imported at the end to avoid cyclic-dependency hell:
from .ViewBox import ViewBox
diff --git a/pyqtgraph/graphicsItems/GraphicsObject.py b/pyqtgraph/graphicsItems/GraphicsObject.py
index d8f55d27..1ea9a08b 100644
--- a/pyqtgraph/graphicsItems/GraphicsObject.py
+++ b/pyqtgraph/graphicsItems/GraphicsObject.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore, USE_PYSIDE
+from ..Qt import QtGui, QtCore, USE_PYSIDE
if not USE_PYSIDE:
import sip
from .GraphicsItem import GraphicsItem
diff --git a/pyqtgraph/graphicsItems/GraphicsWidget.py b/pyqtgraph/graphicsItems/GraphicsWidget.py
index 7650b125..c379ce8e 100644
--- a/pyqtgraph/graphicsItems/GraphicsWidget.py
+++ b/pyqtgraph/graphicsItems/GraphicsWidget.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.GraphicsScene import GraphicsScene
+from ..Qt import QtGui, QtCore
+from ..GraphicsScene import GraphicsScene
from .GraphicsItem import GraphicsItem
__all__ = ['GraphicsWidget']
diff --git a/pyqtgraph/graphicsItems/GridItem.py b/pyqtgraph/graphicsItems/GridItem.py
index 29b0aa2c..87f90a62 100644
--- a/pyqtgraph/graphicsItems/GridItem.py
+++ b/pyqtgraph/graphicsItems/GridItem.py
@@ -1,8 +1,8 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .UIGraphicsItem import *
import numpy as np
-from pyqtgraph.Point import Point
-import pyqtgraph.functions as fn
+from ..Point import Point
+from .. import functions as fn
__all__ = ['GridItem']
class GridItem(UIGraphicsItem):
diff --git a/pyqtgraph/graphicsItems/HistogramLUTItem.py b/pyqtgraph/graphicsItems/HistogramLUTItem.py
index 70d8662f..8474202c 100644
--- a/pyqtgraph/graphicsItems/HistogramLUTItem.py
+++ b/pyqtgraph/graphicsItems/HistogramLUTItem.py
@@ -3,8 +3,8 @@ GraphicsWidget displaying an image histogram along with gradient editor. Can be
"""
-from pyqtgraph.Qt import QtGui, QtCore
-import pyqtgraph.functions as fn
+from ..Qt import QtGui, QtCore
+from .. import functions as fn
from .GraphicsWidget import GraphicsWidget
from .ViewBox import *
from .GradientEditorItem import *
@@ -12,10 +12,10 @@ from .LinearRegionItem import *
from .PlotDataItem import *
from .AxisItem import *
from .GridItem import *
-from pyqtgraph.Point import Point
-import pyqtgraph.functions as fn
+from ..Point import Point
+from .. import functions as fn
import numpy as np
-import pyqtgraph.debug as debug
+from .. import debug as debug
__all__ = ['HistogramLUTItem']
diff --git a/pyqtgraph/graphicsItems/ImageItem.py b/pyqtgraph/graphicsItems/ImageItem.py
index f7a211d9..120312ad 100644
--- a/pyqtgraph/graphicsItems/ImageItem.py
+++ b/pyqtgraph/graphicsItems/ImageItem.py
@@ -1,8 +1,8 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
import numpy as np
import collections
-import pyqtgraph.functions as fn
-import pyqtgraph.debug as debug
+from .. import functions as fn
+from .. import debug as debug
from .GraphicsObject import GraphicsObject
__all__ = ['ImageItem']
diff --git a/pyqtgraph/graphicsItems/InfiniteLine.py b/pyqtgraph/graphicsItems/InfiniteLine.py
index 4f0df863..edf6b19e 100644
--- a/pyqtgraph/graphicsItems/InfiniteLine.py
+++ b/pyqtgraph/graphicsItems/InfiniteLine.py
@@ -1,7 +1,7 @@
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.Point import Point
+from ..Qt import QtGui, QtCore
+from ..Point import Point
from .GraphicsObject import GraphicsObject
-import pyqtgraph.functions as fn
+from .. import functions as fn
import numpy as np
import weakref
diff --git a/pyqtgraph/graphicsItems/IsocurveItem.py b/pyqtgraph/graphicsItems/IsocurveItem.py
index 01ef57b6..71113ba8 100644
--- a/pyqtgraph/graphicsItems/IsocurveItem.py
+++ b/pyqtgraph/graphicsItems/IsocurveItem.py
@@ -1,8 +1,8 @@
from .GraphicsObject import *
-import pyqtgraph.functions as fn
-from pyqtgraph.Qt import QtGui, QtCore
+from .. import functions as fn
+from ..Qt import QtGui, QtCore
class IsocurveItem(GraphicsObject):
diff --git a/pyqtgraph/graphicsItems/ItemGroup.py b/pyqtgraph/graphicsItems/ItemGroup.py
index 930fdf80..4eb0ee0d 100644
--- a/pyqtgraph/graphicsItems/ItemGroup.py
+++ b/pyqtgraph/graphicsItems/ItemGroup.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .GraphicsObject import GraphicsObject
__all__ = ['ItemGroup']
diff --git a/pyqtgraph/graphicsItems/LabelItem.py b/pyqtgraph/graphicsItems/LabelItem.py
index 6101c4bc..37980ee3 100644
--- a/pyqtgraph/graphicsItems/LabelItem.py
+++ b/pyqtgraph/graphicsItems/LabelItem.py
@@ -1,8 +1,8 @@
-from pyqtgraph.Qt import QtGui, QtCore
-import pyqtgraph.functions as fn
-import pyqtgraph as pg
+from ..Qt import QtGui, QtCore
+from .. import functions as fn
from .GraphicsWidget import GraphicsWidget
from .GraphicsWidgetAnchor import GraphicsWidgetAnchor
+from .. import getConfigOption
__all__ = ['LabelItem']
@@ -54,7 +54,7 @@ class LabelItem(GraphicsWidget, GraphicsWidgetAnchor):
color = self.opts['color']
if color is None:
- color = pg.getConfigOption('foreground')
+ color = getConfigOption('foreground')
color = fn.mkColor(color)
optlist.append('color: #' + fn.colorStr(color)[:6])
if 'size' in opts:
diff --git a/pyqtgraph/graphicsItems/LegendItem.py b/pyqtgraph/graphicsItems/LegendItem.py
index 69ddffea..a1228789 100644
--- a/pyqtgraph/graphicsItems/LegendItem.py
+++ b/pyqtgraph/graphicsItems/LegendItem.py
@@ -3,8 +3,9 @@ from .LabelItem import LabelItem
from ..Qt import QtGui, QtCore
from .. import functions as fn
from ..Point import Point
+from .ScatterPlotItem import ScatterPlotItem
+from .PlotDataItem import PlotDataItem
from .GraphicsWidgetAnchor import GraphicsWidgetAnchor
-import pyqtgraph as pg
__all__ = ['LegendItem']
class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
@@ -152,21 +153,21 @@ class ItemSample(GraphicsWidget):
p.setPen(fn.mkPen(None))
p.drawPolygon(QtGui.QPolygonF([QtCore.QPointF(2,18), QtCore.QPointF(18,2), QtCore.QPointF(18,18)]))
- if not isinstance(self.item, pg.ScatterPlotItem):
+ if not isinstance(self.item, ScatterPlotItem):
p.setPen(fn.mkPen(opts['pen']))
p.drawLine(2, 18, 18, 2)
symbol = opts.get('symbol', None)
if symbol is not None:
- if isinstance(self.item, pg.PlotDataItem):
+ if isinstance(self.item, PlotDataItem):
opts = self.item.scatter.opts
- pen = pg.mkPen(opts['pen'])
- brush = pg.mkBrush(opts['brush'])
+ pen = fn.mkPen(opts['pen'])
+ brush = fn.mkBrush(opts['brush'])
size = opts['size']
p.translate(10,10)
- path = pg.graphicsItems.ScatterPlotItem.drawSymbol(p, symbol, size, pen, brush)
+ path = ScatterPlotItem.drawSymbol(p, symbol, size, pen, brush)
diff --git a/pyqtgraph/graphicsItems/LinearRegionItem.py b/pyqtgraph/graphicsItems/LinearRegionItem.py
index 08f7e198..4f9d28dc 100644
--- a/pyqtgraph/graphicsItems/LinearRegionItem.py
+++ b/pyqtgraph/graphicsItems/LinearRegionItem.py
@@ -1,8 +1,8 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .UIGraphicsItem import UIGraphicsItem
from .InfiniteLine import InfiniteLine
-import pyqtgraph.functions as fn
-import pyqtgraph.debug as debug
+from .. import functions as fn
+from .. import debug as debug
__all__ = ['LinearRegionItem']
diff --git a/pyqtgraph/graphicsItems/PlotCurveItem.py b/pyqtgraph/graphicsItems/PlotCurveItem.py
index 93ef195b..b2beaa99 100644
--- a/pyqtgraph/graphicsItems/PlotCurveItem.py
+++ b/pyqtgraph/graphicsItems/PlotCurveItem.py
@@ -1,17 +1,17 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
try:
- from pyqtgraph.Qt import QtOpenGL
+ from ..Qt import QtOpenGL
HAVE_OPENGL = True
except:
HAVE_OPENGL = False
import numpy as np
from .GraphicsObject import GraphicsObject
-import pyqtgraph.functions as fn
-from pyqtgraph import debug
-from pyqtgraph.Point import Point
-import pyqtgraph as pg
+from .. import functions as fn
+from ..Point import Point
import struct, sys
+from .. import getConfigOption
+from .. import debug
__all__ = ['PlotCurveItem']
class PlotCurveItem(GraphicsObject):
@@ -65,7 +65,7 @@ class PlotCurveItem(GraphicsObject):
'brush': None,
'stepMode': False,
'name': None,
- 'antialias': pg.getConfigOption('antialias'),
+ 'antialias': getConfigOption('antialias'),
'connect': 'all',
'mouseWidth': 8, # width of shape responding to mouse click
}
@@ -399,13 +399,13 @@ class PlotCurveItem(GraphicsObject):
self._mouseShape = None
return self.path
- @pg.debug.warnOnException ## raising an exception here causes crash
+ @debug.warnOnException ## raising an exception here causes crash
def paint(self, p, opt, widget):
profiler = debug.Profiler()
if self.xData is None:
return
- if HAVE_OPENGL and pg.getConfigOption('enableExperimental') and isinstance(widget, QtOpenGL.QGLWidget):
+ if HAVE_OPENGL and getConfigOption('enableExperimental') and isinstance(widget, QtOpenGL.QGLWidget):
self.paintGL(p, opt, widget)
return
diff --git a/pyqtgraph/graphicsItems/PlotDataItem.py b/pyqtgraph/graphicsItems/PlotDataItem.py
index 7d46d65c..e8c4145c 100644
--- a/pyqtgraph/graphicsItems/PlotDataItem.py
+++ b/pyqtgraph/graphicsItems/PlotDataItem.py
@@ -1,12 +1,12 @@
-import pyqtgraph.metaarray as metaarray
-from pyqtgraph.Qt import QtCore
+from .. import metaarray as metaarray
+from ..Qt import QtCore
from .GraphicsObject import GraphicsObject
from .PlotCurveItem import PlotCurveItem
from .ScatterPlotItem import ScatterPlotItem
import numpy as np
-import pyqtgraph.functions as fn
-import pyqtgraph.debug as debug
-import pyqtgraph as pg
+from .. import functions as fn
+from .. import debug as debug
+from .. import getConfigOption
class PlotDataItem(GraphicsObject):
"""
@@ -152,7 +152,7 @@ class PlotDataItem(GraphicsObject):
'symbolBrush': (50, 50, 150),
'pxMode': True,
- 'antialias': pg.getConfigOption('antialias'),
+ 'antialias': getConfigOption('antialias'),
'pointMode': None,
'downsample': 1,
diff --git a/pyqtgraph/graphicsItems/PlotItem/PlotItem.py b/pyqtgraph/graphicsItems/PlotItem/PlotItem.py
index b99a3266..baff1aa9 100644
--- a/pyqtgraph/graphicsItems/PlotItem/PlotItem.py
+++ b/pyqtgraph/graphicsItems/PlotItem/PlotItem.py
@@ -16,16 +16,16 @@ This class is very heavily featured:
- Control panel with a huge feature set including averaging, decimation,
display, power spectrum, svg/png export, plot linking, and more.
"""
-from pyqtgraph.Qt import QtGui, QtCore, QtSvg, USE_PYSIDE
-import pyqtgraph.pixmaps
+from ...Qt import QtGui, QtCore, QtSvg, USE_PYSIDE
+from ... import pixmaps
if USE_PYSIDE:
from .plotConfigTemplate_pyside import *
else:
from .plotConfigTemplate_pyqt import *
-import pyqtgraph.functions as fn
-from pyqtgraph.widgets.FileDialog import FileDialog
+from ... import functions as fn
+from ...widgets.FileDialog import FileDialog
import weakref
import numpy as np
import os
@@ -37,7 +37,7 @@ from .. LegendItem import LegendItem
from .. GraphicsWidget import GraphicsWidget
from .. ButtonItem import ButtonItem
from .. InfiniteLine import InfiniteLine
-from pyqtgraph.WidgetGroup import WidgetGroup
+from ...WidgetGroup import WidgetGroup
__all__ = ['PlotItem']
@@ -129,7 +129,7 @@ class PlotItem(GraphicsWidget):
path = os.path.dirname(__file__)
#self.autoImageFile = os.path.join(path, 'auto.png')
#self.lockImageFile = os.path.join(path, 'lock.png')
- self.autoBtn = ButtonItem(pyqtgraph.pixmaps.getPixmap('auto'), 14, self)
+ self.autoBtn = ButtonItem(pixmaps.getPixmap('auto'), 14, self)
self.autoBtn.mode = 'auto'
self.autoBtn.clicked.connect(self.autoBtnClicked)
#self.autoBtn.hide()
diff --git a/pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyqt.py b/pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyqt.py
index 5335ee76..e09c9978 100644
--- a/pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyqt.py
+++ b/pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyqt.py
@@ -2,8 +2,8 @@
# Form implementation generated from reading ui file './pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate.ui'
#
-# Created: Mon Jul 1 23:21:08 2013
-# by: PyQt4 UI code generator 4.9.3
+# Created: Mon Dec 23 10:10:51 2013
+# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
- _fromUtf8 = lambda s: s
+ def _fromUtf8(s):
+ return s
+
+try:
+ _encoding = QtGui.QApplication.UnicodeUTF8
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig, _encoding)
+except AttributeError:
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
@@ -139,35 +148,35 @@ class Ui_Form(object):
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
- Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
- self.averageGroup.setToolTip(QtGui.QApplication.translate("Form", "Display averages of the curves displayed in this plot. The parameter list allows you to choose parameters to average over (if any are available).", None, QtGui.QApplication.UnicodeUTF8))
- self.averageGroup.setTitle(QtGui.QApplication.translate("Form", "Average", None, QtGui.QApplication.UnicodeUTF8))
- self.clipToViewCheck.setToolTip(QtGui.QApplication.translate("Form", "Plot only the portion of each curve that is visible. This assumes X values are uniformly spaced.", None, QtGui.QApplication.UnicodeUTF8))
- self.clipToViewCheck.setText(QtGui.QApplication.translate("Form", "Clip to View", None, QtGui.QApplication.UnicodeUTF8))
- self.maxTracesCheck.setToolTip(QtGui.QApplication.translate("Form", "If multiple curves are displayed in this plot, check this box to limit the number of traces that are displayed.", None, QtGui.QApplication.UnicodeUTF8))
- self.maxTracesCheck.setText(QtGui.QApplication.translate("Form", "Max Traces:", None, QtGui.QApplication.UnicodeUTF8))
- self.downsampleCheck.setText(QtGui.QApplication.translate("Form", "Downsample", None, QtGui.QApplication.UnicodeUTF8))
- self.peakRadio.setToolTip(QtGui.QApplication.translate("Form", "Downsample by drawing a saw wave that follows the min and max of the original data. This method produces the best visual representation of the data but is slower.", None, QtGui.QApplication.UnicodeUTF8))
- self.peakRadio.setText(QtGui.QApplication.translate("Form", "Peak", None, QtGui.QApplication.UnicodeUTF8))
- self.maxTracesSpin.setToolTip(QtGui.QApplication.translate("Form", "If multiple curves are displayed in this plot, check \"Max Traces\" and set this value to limit the number of traces that are displayed.", None, QtGui.QApplication.UnicodeUTF8))
- self.forgetTracesCheck.setToolTip(QtGui.QApplication.translate("Form", "If MaxTraces is checked, remove curves from memory after they are hidden (saves memory, but traces can not be un-hidden).", None, QtGui.QApplication.UnicodeUTF8))
- self.forgetTracesCheck.setText(QtGui.QApplication.translate("Form", "Forget hidden traces", None, QtGui.QApplication.UnicodeUTF8))
- self.meanRadio.setToolTip(QtGui.QApplication.translate("Form", "Downsample by taking the mean of N samples.", None, QtGui.QApplication.UnicodeUTF8))
- self.meanRadio.setText(QtGui.QApplication.translate("Form", "Mean", None, QtGui.QApplication.UnicodeUTF8))
- self.subsampleRadio.setToolTip(QtGui.QApplication.translate("Form", "Downsample by taking the first of N samples. This method is fastest and least accurate.", None, QtGui.QApplication.UnicodeUTF8))
- self.subsampleRadio.setText(QtGui.QApplication.translate("Form", "Subsample", None, QtGui.QApplication.UnicodeUTF8))
- self.autoDownsampleCheck.setToolTip(QtGui.QApplication.translate("Form", "Automatically downsample data based on the visible range. This assumes X values are uniformly spaced.", None, QtGui.QApplication.UnicodeUTF8))
- self.autoDownsampleCheck.setText(QtGui.QApplication.translate("Form", "Auto", None, QtGui.QApplication.UnicodeUTF8))
- self.downsampleSpin.setToolTip(QtGui.QApplication.translate("Form", "Downsample data before plotting. (plot every Nth sample)", None, QtGui.QApplication.UnicodeUTF8))
- self.downsampleSpin.setSuffix(QtGui.QApplication.translate("Form", "x", None, QtGui.QApplication.UnicodeUTF8))
- self.fftCheck.setText(QtGui.QApplication.translate("Form", "Power Spectrum (FFT)", None, QtGui.QApplication.UnicodeUTF8))
- self.logXCheck.setText(QtGui.QApplication.translate("Form", "Log X", None, QtGui.QApplication.UnicodeUTF8))
- self.logYCheck.setText(QtGui.QApplication.translate("Form", "Log Y", None, QtGui.QApplication.UnicodeUTF8))
- self.pointsGroup.setTitle(QtGui.QApplication.translate("Form", "Points", None, QtGui.QApplication.UnicodeUTF8))
- self.autoPointsCheck.setText(QtGui.QApplication.translate("Form", "Auto", None, QtGui.QApplication.UnicodeUTF8))
- self.xGridCheck.setText(QtGui.QApplication.translate("Form", "Show X Grid", None, QtGui.QApplication.UnicodeUTF8))
- self.yGridCheck.setText(QtGui.QApplication.translate("Form", "Show Y Grid", None, QtGui.QApplication.UnicodeUTF8))
- self.label.setText(QtGui.QApplication.translate("Form", "Opacity", None, QtGui.QApplication.UnicodeUTF8))
- self.alphaGroup.setTitle(QtGui.QApplication.translate("Form", "Alpha", None, QtGui.QApplication.UnicodeUTF8))
- self.autoAlphaCheck.setText(QtGui.QApplication.translate("Form", "Auto", None, QtGui.QApplication.UnicodeUTF8))
+ Form.setWindowTitle(_translate("Form", "Form", None))
+ self.averageGroup.setToolTip(_translate("Form", "Display averages of the curves displayed in this plot. The parameter list allows you to choose parameters to average over (if any are available).", None))
+ self.averageGroup.setTitle(_translate("Form", "Average", None))
+ self.clipToViewCheck.setToolTip(_translate("Form", "Plot only the portion of each curve that is visible. This assumes X values are uniformly spaced.", None))
+ self.clipToViewCheck.setText(_translate("Form", "Clip to View", None))
+ self.maxTracesCheck.setToolTip(_translate("Form", "If multiple curves are displayed in this plot, check this box to limit the number of traces that are displayed.", None))
+ self.maxTracesCheck.setText(_translate("Form", "Max Traces:", None))
+ self.downsampleCheck.setText(_translate("Form", "Downsample", None))
+ self.peakRadio.setToolTip(_translate("Form", "Downsample by drawing a saw wave that follows the min and max of the original data. This method produces the best visual representation of the data but is slower.", None))
+ self.peakRadio.setText(_translate("Form", "Peak", None))
+ self.maxTracesSpin.setToolTip(_translate("Form", "If multiple curves are displayed in this plot, check \"Max Traces\" and set this value to limit the number of traces that are displayed.", None))
+ self.forgetTracesCheck.setToolTip(_translate("Form", "If MaxTraces is checked, remove curves from memory after they are hidden (saves memory, but traces can not be un-hidden).", None))
+ self.forgetTracesCheck.setText(_translate("Form", "Forget hidden traces", None))
+ self.meanRadio.setToolTip(_translate("Form", "Downsample by taking the mean of N samples.", None))
+ self.meanRadio.setText(_translate("Form", "Mean", None))
+ self.subsampleRadio.setToolTip(_translate("Form", "Downsample by taking the first of N samples. This method is fastest and least accurate.", None))
+ self.subsampleRadio.setText(_translate("Form", "Subsample", None))
+ self.autoDownsampleCheck.setToolTip(_translate("Form", "Automatically downsample data based on the visible range. This assumes X values are uniformly spaced.", None))
+ self.autoDownsampleCheck.setText(_translate("Form", "Auto", None))
+ self.downsampleSpin.setToolTip(_translate("Form", "Downsample data before plotting. (plot every Nth sample)", None))
+ self.downsampleSpin.setSuffix(_translate("Form", "x", None))
+ self.fftCheck.setText(_translate("Form", "Power Spectrum (FFT)", None))
+ self.logXCheck.setText(_translate("Form", "Log X", None))
+ self.logYCheck.setText(_translate("Form", "Log Y", None))
+ self.pointsGroup.setTitle(_translate("Form", "Points", None))
+ self.autoPointsCheck.setText(_translate("Form", "Auto", None))
+ self.xGridCheck.setText(_translate("Form", "Show X Grid", None))
+ self.yGridCheck.setText(_translate("Form", "Show Y Grid", None))
+ self.label.setText(_translate("Form", "Opacity", None))
+ self.alphaGroup.setTitle(_translate("Form", "Alpha", None))
+ self.autoAlphaCheck.setText(_translate("Form", "Auto", None))
diff --git a/pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyside.py b/pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyside.py
index b8e0b19e..aff31211 100644
--- a/pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyside.py
+++ b/pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyside.py
@@ -2,8 +2,8 @@
# Form implementation generated from reading ui file './pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate.ui'
#
-# Created: Mon Jul 1 23:21:08 2013
-# by: pyside-uic 0.2.13 running on PySide 1.1.2
+# Created: Mon Dec 23 10:10:52 2013
+# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
diff --git a/pyqtgraph/graphicsItems/ROI.py b/pyqtgraph/graphicsItems/ROI.py
index cb5f4f30..0dee2fd4 100644
--- a/pyqtgraph/graphicsItems/ROI.py
+++ b/pyqtgraph/graphicsItems/ROI.py
@@ -12,16 +12,16 @@ The ROI class is meant to serve as the base for more specific types; see several
of how to build an ROI at the bottom of the file.
"""
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
#if not hasattr(QtCore, 'Signal'):
#QtCore.Signal = QtCore.pyqtSignal
import numpy as np
from numpy.linalg import norm
import scipy.ndimage as ndimage
-from pyqtgraph.Point import *
-from pyqtgraph.SRTTransform import SRTTransform
+from ..Point import *
+from ..SRTTransform import SRTTransform
from math import cos, sin
-import pyqtgraph.functions as fn
+from .. import functions as fn
from .GraphicsObject import GraphicsObject
from .UIGraphicsItem import UIGraphicsItem
diff --git a/pyqtgraph/graphicsItems/ScaleBar.py b/pyqtgraph/graphicsItems/ScaleBar.py
index 768f6978..66258678 100644
--- a/pyqtgraph/graphicsItems/ScaleBar.py
+++ b/pyqtgraph/graphicsItems/ScaleBar.py
@@ -1,10 +1,10 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .GraphicsObject import *
from .GraphicsWidgetAnchor import *
from .TextItem import TextItem
import numpy as np
-import pyqtgraph.functions as fn
-import pyqtgraph as pg
+from .. import functions as fn
+from .. import getConfigOption
__all__ = ['ScaleBar']
@@ -19,7 +19,7 @@ class ScaleBar(GraphicsObject, GraphicsWidgetAnchor):
self.setAcceptedMouseButtons(QtCore.Qt.NoButton)
if brush is None:
- brush = pg.getConfigOption('foreground')
+ brush = getConfigOption('foreground')
self.brush = fn.mkBrush(brush)
self.pen = fn.mkPen(pen)
self._width = width
diff --git a/pyqtgraph/graphicsItems/ScatterPlotItem.py b/pyqtgraph/graphicsItems/ScatterPlotItem.py
index 498df2cd..926c9045 100644
--- a/pyqtgraph/graphicsItems/ScatterPlotItem.py
+++ b/pyqtgraph/graphicsItems/ScatterPlotItem.py
@@ -1,14 +1,14 @@
-from pyqtgraph.Qt import QtGui, QtCore, USE_PYSIDE
-from pyqtgraph.Point import Point
-import pyqtgraph.functions as fn
+from ..Qt import QtGui, QtCore, USE_PYSIDE
+from ..Point import Point
+from .. import functions as fn
from .GraphicsItem import GraphicsItem
from .GraphicsObject import GraphicsObject
import numpy as np
import weakref
-import pyqtgraph.debug as debug
-from pyqtgraph.pgcollections import OrderedDict
-import pyqtgraph as pg
-#import pyqtgraph as pg
+from .. import getConfigOption
+from .. import debug as debug
+from ..pgcollections import OrderedDict
+from .. import debug
__all__ = ['ScatterPlotItem', 'SpotItem']
@@ -233,7 +233,7 @@ class ScatterPlotItem(GraphicsObject):
self.opts = {
'pxMode': True,
'useCache': True, ## If useCache is False, symbols are re-drawn on every paint.
- 'antialias': pg.getConfigOption('antialias'),
+ 'antialias': getConfigOption('antialias'),
'name': None,
}
@@ -693,7 +693,7 @@ class ScatterPlotItem(GraphicsObject):
GraphicsObject.setExportMode(self, *args, **kwds)
self.invalidate()
- @pg.debug.warnOnException ## raising an exception here causes crash
+ @debug.warnOnException ## raising an exception here causes crash
def paint(self, p, *args):
#p.setPen(fn.mkPen('r'))
diff --git a/pyqtgraph/graphicsItems/TextItem.py b/pyqtgraph/graphicsItems/TextItem.py
index 911057f4..2b5ea51c 100644
--- a/pyqtgraph/graphicsItems/TextItem.py
+++ b/pyqtgraph/graphicsItems/TextItem.py
@@ -1,7 +1,7 @@
-from pyqtgraph.Qt import QtCore, QtGui
-import pyqtgraph as pg
+from ..Qt import QtCore, QtGui
+from ..Point import Point
from .UIGraphicsItem import *
-import pyqtgraph.functions as fn
+from .. import functions as fn
class TextItem(UIGraphicsItem):
"""
@@ -27,7 +27,7 @@ class TextItem(UIGraphicsItem):
#*angle* Angle in degrees to rotate text (note that the rotation assigned in this item's
#transformation will be ignored)
- self.anchor = pg.Point(anchor)
+ self.anchor = Point(anchor)
#self.angle = 0
UIGraphicsItem.__init__(self)
self.textItem = QtGui.QGraphicsTextItem()
@@ -38,13 +38,13 @@ class TextItem(UIGraphicsItem):
self.setText(text, color)
else:
self.setHtml(html)
- self.fill = pg.mkBrush(fill)
- self.border = pg.mkPen(border)
+ self.fill = fn.mkBrush(fill)
+ self.border = fn.mkPen(border)
self.rotate(angle)
self.setFlag(self.ItemIgnoresTransformations) ## This is required to keep the text unscaled inside the viewport
def setText(self, text, color=(200,200,200)):
- color = pg.mkColor(color)
+ color = fn.mkColor(color)
self.textItem.setDefaultTextColor(color)
self.textItem.setPlainText(text)
self.updateText()
@@ -89,7 +89,7 @@ class TextItem(UIGraphicsItem):
#br = self.textItem.mapRectToParent(self.textItem.boundingRect())
self.textItem.setPos(0,0)
br = self.textItem.boundingRect()
- apos = self.textItem.mapToParent(pg.Point(br.width()*self.anchor.x(), br.height()*self.anchor.y()))
+ apos = self.textItem.mapToParent(Point(br.width()*self.anchor.x(), br.height()*self.anchor.y()))
#print br, apos
self.textItem.setPos(-apos.x(), -apos.y())
diff --git a/pyqtgraph/graphicsItems/UIGraphicsItem.py b/pyqtgraph/graphicsItems/UIGraphicsItem.py
index 19fda424..6f756334 100644
--- a/pyqtgraph/graphicsItems/UIGraphicsItem.py
+++ b/pyqtgraph/graphicsItems/UIGraphicsItem.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore, USE_PYSIDE
+from ..Qt import QtGui, QtCore, USE_PYSIDE
import weakref
from .GraphicsObject import GraphicsObject
if not USE_PYSIDE:
diff --git a/pyqtgraph/graphicsItems/VTickGroup.py b/pyqtgraph/graphicsItems/VTickGroup.py
index c6880f91..4b315678 100644
--- a/pyqtgraph/graphicsItems/VTickGroup.py
+++ b/pyqtgraph/graphicsItems/VTickGroup.py
@@ -3,8 +3,8 @@ if __name__ == '__main__':
path = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(path, '..', '..'))
-from pyqtgraph.Qt import QtGui, QtCore
-import pyqtgraph.functions as fn
+from ..Qt import QtGui, QtCore
+from .. import functions as fn
import weakref
from .UIGraphicsItem import UIGraphicsItem
@@ -96,18 +96,4 @@ class VTickGroup(UIGraphicsItem):
p.setPen(self.pen)
p.drawPath(self.path)
-
-if __name__ == '__main__':
- app = QtGui.QApplication([])
- import pyqtgraph as pg
- vt = VTickGroup([1,3,4,7,9], [0.8, 1.0])
- p = pg.plot()
- p.addItem(vt)
-
- if sys.flags.interactive == 0:
- app.exec_()
-
-
-
-
\ No newline at end of file
diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py
index 17bd2207..70012ec4 100644
--- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py
+++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py
@@ -1,15 +1,15 @@
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.python2_3 import sortList
+from ...Qt import QtGui, QtCore
+from ...python2_3 import sortList
import numpy as np
-from pyqtgraph.Point import Point
-import pyqtgraph.functions as fn
+from ...Point import Point
+from ... import functions as fn
from .. ItemGroup import ItemGroup
from .. GraphicsWidget import GraphicsWidget
-from pyqtgraph.GraphicsScene import GraphicsScene
-import pyqtgraph
+from ...GraphicsScene import GraphicsScene
import weakref
from copy import deepcopy
-import pyqtgraph.debug as debug
+from ... import debug as debug
+from ... import getConfigOption
__all__ = ['ViewBox']
@@ -113,7 +113,7 @@ class ViewBox(GraphicsWidget):
## a name string indicates that the view *should* link to another, but no view with that name exists yet.
'mouseEnabled': [enableMouse, enableMouse],
- 'mouseMode': ViewBox.PanMode if pyqtgraph.getConfigOption('leftButtonPan') else ViewBox.RectMode,
+ 'mouseMode': ViewBox.PanMode if getConfigOption('leftButtonPan') else ViewBox.RectMode,
'enableMenu': enableMenu,
'wheelScaleFactor': -1.0 / 8.0,
diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py b/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py
index 15d0be06..af142771 100644
--- a/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py
+++ b/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py
@@ -1,6 +1,6 @@
-from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE
-from pyqtgraph.python2_3 import asUnicode
-from pyqtgraph.WidgetGroup import WidgetGroup
+from ...Qt import QtCore, QtGui, USE_PYSIDE
+from ...python2_3 import asUnicode
+from ...WidgetGroup import WidgetGroup
if USE_PYSIDE:
from .axisCtrlTemplate_pyside import Ui_Form as AxisCtrlTemplate
diff --git a/pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate_pyqt.py b/pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate_pyqt.py
index db14033e..d8ef1925 100644
--- a/pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate_pyqt.py
+++ b/pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate_pyqt.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './graphicsItems/ViewBox/axisCtrlTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate.ui'
#
-# Created: Sun Sep 9 14:41:31 2012
-# by: PyQt4 UI code generator 4.9.1
+# Created: Mon Dec 23 10:10:51 2013
+# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
- _fromUtf8 = lambda s: s
+ def _fromUtf8(s):
+ return s
+
+try:
+ _encoding = QtGui.QApplication.UnicodeUTF8
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig, _encoding)
+except AttributeError:
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
@@ -69,25 +78,25 @@ class Ui_Form(object):
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
- Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
- self.label.setText(QtGui.QApplication.translate("Form", "Link Axis:", None, QtGui.QApplication.UnicodeUTF8))
- self.linkCombo.setToolTip(QtGui.QApplication.translate("Form", "
Links this axis with another view. When linked, both views will display the same data range.
", None, QtGui.QApplication.UnicodeUTF8))
- self.autoPercentSpin.setToolTip(QtGui.QApplication.translate("Form", "Percent of data to be visible when auto-scaling. It may be useful to decrease this value for data with spiky noise.
", None, QtGui.QApplication.UnicodeUTF8))
- self.autoPercentSpin.setSuffix(QtGui.QApplication.translate("Form", "%", None, QtGui.QApplication.UnicodeUTF8))
- self.autoRadio.setToolTip(QtGui.QApplication.translate("Form", "Automatically resize this axis whenever the displayed data is changed.
", None, QtGui.QApplication.UnicodeUTF8))
- self.autoRadio.setText(QtGui.QApplication.translate("Form", "Auto", None, QtGui.QApplication.UnicodeUTF8))
- self.manualRadio.setToolTip(QtGui.QApplication.translate("Form", "Set the range for this axis manually. This disables automatic scaling.
", None, QtGui.QApplication.UnicodeUTF8))
- self.manualRadio.setText(QtGui.QApplication.translate("Form", "Manual", None, QtGui.QApplication.UnicodeUTF8))
- self.minText.setToolTip(QtGui.QApplication.translate("Form", "Minimum value to display for this axis.
", None, QtGui.QApplication.UnicodeUTF8))
- self.minText.setText(QtGui.QApplication.translate("Form", "0", None, QtGui.QApplication.UnicodeUTF8))
- self.maxText.setToolTip(QtGui.QApplication.translate("Form", "Maximum value to display for this axis.
", None, QtGui.QApplication.UnicodeUTF8))
- self.maxText.setText(QtGui.QApplication.translate("Form", "0", None, QtGui.QApplication.UnicodeUTF8))
- self.invertCheck.setToolTip(QtGui.QApplication.translate("Form", "Inverts the display of this axis. (+y points downward instead of upward)
", None, QtGui.QApplication.UnicodeUTF8))
- self.invertCheck.setText(QtGui.QApplication.translate("Form", "Invert Axis", None, QtGui.QApplication.UnicodeUTF8))
- self.mouseCheck.setToolTip(QtGui.QApplication.translate("Form", "Enables mouse interaction (panning, scaling) for this axis.
", None, QtGui.QApplication.UnicodeUTF8))
- self.mouseCheck.setText(QtGui.QApplication.translate("Form", "Mouse Enabled", None, QtGui.QApplication.UnicodeUTF8))
- self.visibleOnlyCheck.setToolTip(QtGui.QApplication.translate("Form", "When checked, the axis will only auto-scale to data that is visible along the orthogonal axis.
", None, QtGui.QApplication.UnicodeUTF8))
- self.visibleOnlyCheck.setText(QtGui.QApplication.translate("Form", "Visible Data Only", None, QtGui.QApplication.UnicodeUTF8))
- self.autoPanCheck.setToolTip(QtGui.QApplication.translate("Form", "When checked, the axis will automatically pan to center on the current data, but the scale along this axis will not change.
", None, QtGui.QApplication.UnicodeUTF8))
- self.autoPanCheck.setText(QtGui.QApplication.translate("Form", "Auto Pan Only", None, QtGui.QApplication.UnicodeUTF8))
+ Form.setWindowTitle(_translate("Form", "Form", None))
+ self.label.setText(_translate("Form", "Link Axis:", None))
+ self.linkCombo.setToolTip(_translate("Form", "Links this axis with another view. When linked, both views will display the same data range.
", None))
+ self.autoPercentSpin.setToolTip(_translate("Form", "Percent of data to be visible when auto-scaling. It may be useful to decrease this value for data with spiky noise.
", None))
+ self.autoPercentSpin.setSuffix(_translate("Form", "%", None))
+ self.autoRadio.setToolTip(_translate("Form", "Automatically resize this axis whenever the displayed data is changed.
", None))
+ self.autoRadio.setText(_translate("Form", "Auto", None))
+ self.manualRadio.setToolTip(_translate("Form", "Set the range for this axis manually. This disables automatic scaling.
", None))
+ self.manualRadio.setText(_translate("Form", "Manual", None))
+ self.minText.setToolTip(_translate("Form", "Minimum value to display for this axis.
", None))
+ self.minText.setText(_translate("Form", "0", None))
+ self.maxText.setToolTip(_translate("Form", "Maximum value to display for this axis.
", None))
+ self.maxText.setText(_translate("Form", "0", None))
+ self.invertCheck.setToolTip(_translate("Form", "Inverts the display of this axis. (+y points downward instead of upward)
", None))
+ self.invertCheck.setText(_translate("Form", "Invert Axis", None))
+ self.mouseCheck.setToolTip(_translate("Form", "Enables mouse interaction (panning, scaling) for this axis.
", None))
+ self.mouseCheck.setText(_translate("Form", "Mouse Enabled", None))
+ self.visibleOnlyCheck.setToolTip(_translate("Form", "When checked, the axis will only auto-scale to data that is visible along the orthogonal axis.
", None))
+ self.visibleOnlyCheck.setText(_translate("Form", "Visible Data Only", None))
+ self.autoPanCheck.setToolTip(_translate("Form", "When checked, the axis will automatically pan to center on the current data, but the scale along this axis will not change.
", None))
+ self.autoPanCheck.setText(_translate("Form", "Auto Pan Only", None))
diff --git a/pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate_pyside.py b/pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate_pyside.py
index 18510bc2..9ddeb5d1 100644
--- a/pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate_pyside.py
+++ b/pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate_pyside.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './graphicsItems/ViewBox/axisCtrlTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate.ui'
#
-# Created: Sun Sep 9 14:41:32 2012
-# by: pyside-uic 0.2.13 running on PySide 1.1.0
+# Created: Mon Dec 23 10:10:51 2013
+# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
diff --git a/pyqtgraph/imageview/ImageView.py b/pyqtgraph/imageview/ImageView.py
index 25700d93..d4458a0e 100644
--- a/pyqtgraph/imageview/ImageView.py
+++ b/pyqtgraph/imageview/ImageView.py
@@ -12,29 +12,29 @@ Widget used for displaying 2D or 3D data. Features:
- ROI plotting
- Image normalization through a variety of methods
"""
-from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE
+from ..Qt import QtCore, QtGui, USE_PYSIDE
if USE_PYSIDE:
from .ImageViewTemplate_pyside import *
else:
from .ImageViewTemplate_pyqt import *
-from pyqtgraph.graphicsItems.ImageItem import *
-from pyqtgraph.graphicsItems.ROI import *
-from pyqtgraph.graphicsItems.LinearRegionItem import *
-from pyqtgraph.graphicsItems.InfiniteLine import *
-from pyqtgraph.graphicsItems.ViewBox import *
+from ..graphicsItems.ImageItem import *
+from ..graphicsItems.ROI import *
+from ..graphicsItems.LinearRegionItem import *
+from ..graphicsItems.InfiniteLine import *
+from ..graphicsItems.ViewBox import *
#from widgets import ROI
import sys
#from numpy import ndarray
-import pyqtgraph.ptime as ptime
+from .. import ptime as ptime
import numpy as np
-import pyqtgraph.debug as debug
+from .. import debug as debug
-from pyqtgraph.SignalProxy import SignalProxy
+from ..SignalProxy import SignalProxy
#try:
- #import pyqtgraph.metaarray as metaarray
+ #from .. import metaarray as metaarray
#HAVE_METAARRAY = True
#except:
#HAVE_METAARRAY = False
diff --git a/pyqtgraph/imageview/ImageViewTemplate.ui b/pyqtgraph/imageview/ImageViewTemplate.ui
index 497c0c59..9a3dab03 100644
--- a/pyqtgraph/imageview/ImageViewTemplate.ui
+++ b/pyqtgraph/imageview/ImageViewTemplate.ui
@@ -233,18 +233,18 @@
PlotWidget
QWidget
- pyqtgraph.widgets.PlotWidget
+
1
GraphicsView
QGraphicsView
- pyqtgraph.widgets.GraphicsView
+
HistogramLUTWidget
QGraphicsView
- pyqtgraph.widgets.HistogramLUTWidget
+ ..widgets.HistogramLUTWidget
diff --git a/pyqtgraph/imageview/ImageViewTemplate_pyqt.py b/pyqtgraph/imageview/ImageViewTemplate_pyqt.py
index e6423276..78156317 100644
--- a/pyqtgraph/imageview/ImageViewTemplate_pyqt.py
+++ b/pyqtgraph/imageview/ImageViewTemplate_pyqt.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './imageview/ImageViewTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/imageview/ImageViewTemplate.ui'
#
-# Created: Sun Sep 9 14:41:30 2012
-# by: PyQt4 UI code generator 4.9.1
+# Created: Mon Dec 23 10:10:52 2013
+# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,16 @@ from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
- _fromUtf8 = lambda s: s
+ def _fromUtf8(s):
+ return s
+
+try:
+ _encoding = QtGui.QApplication.UnicodeUTF8
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig, _encoding)
+except AttributeError:
+ def _translate(context, text, disambig):
+ return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
@@ -138,23 +147,23 @@ class Ui_Form(object):
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
- Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
- self.roiBtn.setText(QtGui.QApplication.translate("Form", "ROI", None, QtGui.QApplication.UnicodeUTF8))
- self.normBtn.setText(QtGui.QApplication.translate("Form", "Norm", None, QtGui.QApplication.UnicodeUTF8))
- self.normGroup.setTitle(QtGui.QApplication.translate("Form", "Normalization", None, QtGui.QApplication.UnicodeUTF8))
- self.normSubtractRadio.setText(QtGui.QApplication.translate("Form", "Subtract", None, QtGui.QApplication.UnicodeUTF8))
- self.normDivideRadio.setText(QtGui.QApplication.translate("Form", "Divide", None, QtGui.QApplication.UnicodeUTF8))
- self.label_5.setText(QtGui.QApplication.translate("Form", "Operation:", None, QtGui.QApplication.UnicodeUTF8))
- self.label_3.setText(QtGui.QApplication.translate("Form", "Mean:", None, QtGui.QApplication.UnicodeUTF8))
- self.label_4.setText(QtGui.QApplication.translate("Form", "Blur:", None, QtGui.QApplication.UnicodeUTF8))
- self.normROICheck.setText(QtGui.QApplication.translate("Form", "ROI", None, QtGui.QApplication.UnicodeUTF8))
- self.label_8.setText(QtGui.QApplication.translate("Form", "X", None, QtGui.QApplication.UnicodeUTF8))
- self.label_9.setText(QtGui.QApplication.translate("Form", "Y", None, QtGui.QApplication.UnicodeUTF8))
- self.label_10.setText(QtGui.QApplication.translate("Form", "T", None, QtGui.QApplication.UnicodeUTF8))
- self.normOffRadio.setText(QtGui.QApplication.translate("Form", "Off", None, QtGui.QApplication.UnicodeUTF8))
- self.normTimeRangeCheck.setText(QtGui.QApplication.translate("Form", "Time range", None, QtGui.QApplication.UnicodeUTF8))
- self.normFrameCheck.setText(QtGui.QApplication.translate("Form", "Frame", None, QtGui.QApplication.UnicodeUTF8))
+ Form.setWindowTitle(_translate("Form", "Form", None))
+ self.roiBtn.setText(_translate("Form", "ROI", None))
+ self.normBtn.setText(_translate("Form", "Norm", None))
+ self.normGroup.setTitle(_translate("Form", "Normalization", None))
+ self.normSubtractRadio.setText(_translate("Form", "Subtract", None))
+ self.normDivideRadio.setText(_translate("Form", "Divide", None))
+ self.label_5.setText(_translate("Form", "Operation:", None))
+ self.label_3.setText(_translate("Form", "Mean:", None))
+ self.label_4.setText(_translate("Form", "Blur:", None))
+ self.normROICheck.setText(_translate("Form", "ROI", None))
+ self.label_8.setText(_translate("Form", "X", None))
+ self.label_9.setText(_translate("Form", "Y", None))
+ self.label_10.setText(_translate("Form", "T", None))
+ self.normOffRadio.setText(_translate("Form", "Off", None))
+ self.normTimeRangeCheck.setText(_translate("Form", "Time range", None))
+ self.normFrameCheck.setText(_translate("Form", "Frame", None))
-from pyqtgraph.widgets.GraphicsView import GraphicsView
-from pyqtgraph.widgets.PlotWidget import PlotWidget
-from pyqtgraph.widgets.HistogramLUTWidget import HistogramLUTWidget
+from ..widgets.HistogramLUTWidget import HistogramLUTWidget
+from ..widgets.GraphicsView import GraphicsView
+from ..widgets.PlotWidget import PlotWidget
diff --git a/pyqtgraph/imageview/ImageViewTemplate_pyside.py b/pyqtgraph/imageview/ImageViewTemplate_pyside.py
index c17bbfe1..2f8b570b 100644
--- a/pyqtgraph/imageview/ImageViewTemplate_pyside.py
+++ b/pyqtgraph/imageview/ImageViewTemplate_pyside.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file './imageview/ImageViewTemplate.ui'
+# Form implementation generated from reading ui file './pyqtgraph/imageview/ImageViewTemplate.ui'
#
-# Created: Sun Sep 9 14:41:31 2012
-# by: pyside-uic 0.2.13 running on PySide 1.1.0
+# Created: Mon Dec 23 10:10:52 2013
+# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
@@ -150,6 +150,6 @@ class Ui_Form(object):
self.normTimeRangeCheck.setText(QtGui.QApplication.translate("Form", "Time range", None, QtGui.QApplication.UnicodeUTF8))
self.normFrameCheck.setText(QtGui.QApplication.translate("Form", "Frame", None, QtGui.QApplication.UnicodeUTF8))
-from pyqtgraph.widgets.GraphicsView import GraphicsView
-from pyqtgraph.widgets.PlotWidget import PlotWidget
-from pyqtgraph.widgets.HistogramLUTWidget import HistogramLUTWidget
+from ..widgets.HistogramLUTWidget import HistogramLUTWidget
+from ..widgets.GraphicsView import GraphicsView
+from ..widgets.PlotWidget import PlotWidget
diff --git a/pyqtgraph/metaarray/MetaArray.py b/pyqtgraph/metaarray/MetaArray.py
index f55c60dc..d24a7d05 100644
--- a/pyqtgraph/metaarray/MetaArray.py
+++ b/pyqtgraph/metaarray/MetaArray.py
@@ -929,7 +929,7 @@ class MetaArray(object):
if proc == False:
raise Exception('remote read failed')
if proc == None:
- import pyqtgraph.multiprocess as mp
+ from .. import multiprocess as mp
#print "new process"
proc = mp.Process(executable='/usr/bin/python')
proc.setProxyOptions(deferGetattr=True)
@@ -1471,4 +1471,4 @@ if __name__ == '__main__':
ma2 = MetaArray(file=tf, mmap=True)
print("\nArrays are equivalent:", (ma == ma2).all())
os.remove(tf)
-
\ No newline at end of file
+
diff --git a/pyqtgraph/multiprocess/parallelizer.py b/pyqtgraph/multiprocess/parallelizer.py
index e96692e2..4ad30b6e 100644
--- a/pyqtgraph/multiprocess/parallelizer.py
+++ b/pyqtgraph/multiprocess/parallelizer.py
@@ -63,8 +63,8 @@ class Parallelize(object):
self.showProgress = True
if isinstance(progressDialog, basestring):
progressDialog = {'labelText': progressDialog}
- import pyqtgraph as pg
- self.progressDlg = pg.ProgressDialog(**progressDialog)
+ from ..widgets.ProgressDialog import ProgressDialog
+ self.progressDlg = ProgressDialog(**progressDialog)
if workers is None:
workers = self.suggestedWorkerCount()
diff --git a/pyqtgraph/multiprocess/processes.py b/pyqtgraph/multiprocess/processes.py
index 4d32c999..5a4ccb99 100644
--- a/pyqtgraph/multiprocess/processes.py
+++ b/pyqtgraph/multiprocess/processes.py
@@ -1,7 +1,8 @@
from .remoteproxy import RemoteEventHandler, ClosedError, NoResultError, LocalObjectProxy, ObjectProxy
import subprocess, atexit, os, sys, time, random, socket, signal
import multiprocessing.connection
-import pyqtgraph as pg
+from ..Qt import USE_PYSIDE
+
try:
import cPickle as pickle
except ImportError:
@@ -118,7 +119,7 @@ class Process(RemoteEventHandler):
ppid=pid,
targetStr=targetStr,
path=sysPath,
- pyside=pg.Qt.USE_PYSIDE,
+ pyside=USE_PYSIDE,
debug=debug
)
pickle.dump(data, self.proc.stdin)
@@ -337,7 +338,7 @@ class RemoteQtEventHandler(RemoteEventHandler):
RemoteEventHandler.__init__(self, *args, **kwds)
def startEventTimer(self):
- from pyqtgraph.Qt import QtGui, QtCore
+ from ..Qt import QtGui, QtCore
self.timer = QtCore.QTimer()
self.timer.timeout.connect(self.processRequests)
self.timer.start(10)
@@ -346,7 +347,7 @@ class RemoteQtEventHandler(RemoteEventHandler):
try:
RemoteEventHandler.processRequests(self)
except ClosedError:
- from pyqtgraph.Qt import QtGui, QtCore
+ from ..Qt import QtGui, QtCore
QtGui.QApplication.instance().quit()
self.timer.stop()
#raise SystemExit
@@ -384,7 +385,7 @@ class QtProcess(Process):
self.startEventTimer()
def startEventTimer(self):
- from pyqtgraph.Qt import QtGui, QtCore ## avoid module-level import to keep bootstrap snappy.
+ from ..Qt import QtGui, QtCore ## avoid module-level import to keep bootstrap snappy.
self.timer = QtCore.QTimer()
if self._processRequests:
app = QtGui.QApplication.instance()
@@ -415,7 +416,7 @@ def startQtEventLoop(name, port, authkey, ppid, debug=False):
conn = multiprocessing.connection.Client(('localhost', int(port)), authkey=authkey)
if debug:
print('[%d] connected; starting remote proxy.' % os.getpid())
- from pyqtgraph.Qt import QtGui, QtCore
+ from ..Qt import QtGui, QtCore
#from PyQt4 import QtGui, QtCore
app = QtGui.QApplication.instance()
#print app
diff --git a/pyqtgraph/opengl/GLGraphicsItem.py b/pyqtgraph/opengl/GLGraphicsItem.py
index 9680fba7..cdfaa683 100644
--- a/pyqtgraph/opengl/GLGraphicsItem.py
+++ b/pyqtgraph/opengl/GLGraphicsItem.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph import Transform3D
+from ..Qt import QtGui, QtCore
+from .. import Transform3D
from OpenGL.GL import *
from OpenGL import GL
diff --git a/pyqtgraph/opengl/GLViewWidget.py b/pyqtgraph/opengl/GLViewWidget.py
index 89fef92e..d74a13ce 100644
--- a/pyqtgraph/opengl/GLViewWidget.py
+++ b/pyqtgraph/opengl/GLViewWidget.py
@@ -1,9 +1,9 @@
-from pyqtgraph.Qt import QtCore, QtGui, QtOpenGL
+from ..Qt import QtCore, QtGui, QtOpenGL
from OpenGL.GL import *
import OpenGL.GL.framebufferobjects as glfbo
import numpy as np
-from pyqtgraph import Vector
-import pyqtgraph.functions as fn
+from .. import Vector
+from .. import functions as fn
##Vector = QtGui.QVector3D
@@ -179,7 +179,7 @@ class GLViewWidget(QtOpenGL.QGLWidget):
self._itemNames[id(i)] = i
i.paint()
except:
- import pyqtgraph.debug
+ from .. import debug
pyqtgraph.debug.printExc()
msg = "Error while drawing item %s." % str(item)
ver = glGetString(GL_VERSION)
@@ -345,7 +345,7 @@ class GLViewWidget(QtOpenGL.QGLWidget):
## Only to be called from within exception handler.
ver = glGetString(GL_VERSION).split()[0]
if int(ver.split('.')[0]) < 2:
- import pyqtgraph.debug
+ from .. import debug
pyqtgraph.debug.printExc()
raise Exception(msg + " The original exception is printed above; however, pyqtgraph requires OpenGL version 2.0 or greater for many of its 3D features and your OpenGL version is %s. Installing updated display drivers may resolve this issue." % ver)
else:
diff --git a/pyqtgraph/opengl/MeshData.py b/pyqtgraph/opengl/MeshData.py
index 71e566c9..3046459d 100644
--- a/pyqtgraph/opengl/MeshData.py
+++ b/pyqtgraph/opengl/MeshData.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtGui
-import pyqtgraph.functions as fn
+from ..Qt import QtGui
+from .. import functions as fn
import numpy as np
class MeshData(object):
diff --git a/pyqtgraph/opengl/__init__.py b/pyqtgraph/opengl/__init__.py
index d10932a5..931003e4 100644
--- a/pyqtgraph/opengl/__init__.py
+++ b/pyqtgraph/opengl/__init__.py
@@ -1,7 +1,7 @@
from .GLViewWidget import GLViewWidget
## dynamic imports cause too many problems.
-#from pyqtgraph import importAll
+#from .. import importAll
#importAll('items', globals(), locals())
from .items.GLGridItem import *
diff --git a/pyqtgraph/opengl/glInfo.py b/pyqtgraph/opengl/glInfo.py
index 28da1f69..84346d81 100644
--- a/pyqtgraph/opengl/glInfo.py
+++ b/pyqtgraph/opengl/glInfo.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtCore, QtGui, QtOpenGL
+from ..Qt import QtCore, QtGui, QtOpenGL
from OpenGL.GL import *
app = QtGui.QApplication([])
diff --git a/pyqtgraph/opengl/items/GLAxisItem.py b/pyqtgraph/opengl/items/GLAxisItem.py
index 860ac497..c6c206e4 100644
--- a/pyqtgraph/opengl/items/GLAxisItem.py
+++ b/pyqtgraph/opengl/items/GLAxisItem.py
@@ -1,6 +1,6 @@
from OpenGL.GL import *
from .. GLGraphicsItem import GLGraphicsItem
-from pyqtgraph import QtGui
+from ... import QtGui
__all__ = ['GLAxisItem']
diff --git a/pyqtgraph/opengl/items/GLBoxItem.py b/pyqtgraph/opengl/items/GLBoxItem.py
index bc25afd1..f0a6ae6c 100644
--- a/pyqtgraph/opengl/items/GLBoxItem.py
+++ b/pyqtgraph/opengl/items/GLBoxItem.py
@@ -1,7 +1,7 @@
from OpenGL.GL import *
from .. GLGraphicsItem import GLGraphicsItem
-from pyqtgraph.Qt import QtGui
-import pyqtgraph as pg
+from ...Qt import QtGui
+from ... import functions as fn
__all__ = ['GLBoxItem']
@@ -38,7 +38,7 @@ class GLBoxItem(GLGraphicsItem):
def setColor(self, *args):
"""Set the color of the box. Arguments are the same as those accepted by functions.mkColor()"""
- self.__color = pg.Color(*args)
+ self.__color = fn.Color(*args)
def color(self):
return self.__color
diff --git a/pyqtgraph/opengl/items/GLGridItem.py b/pyqtgraph/opengl/items/GLGridItem.py
index 01a2b178..2c4642c8 100644
--- a/pyqtgraph/opengl/items/GLGridItem.py
+++ b/pyqtgraph/opengl/items/GLGridItem.py
@@ -1,6 +1,6 @@
from OpenGL.GL import *
from .. GLGraphicsItem import GLGraphicsItem
-from pyqtgraph import QtGui
+from ... import QtGui
__all__ = ['GLGridItem']
diff --git a/pyqtgraph/opengl/items/GLImageItem.py b/pyqtgraph/opengl/items/GLImageItem.py
index aca68f3d..2cab23a3 100644
--- a/pyqtgraph/opengl/items/GLImageItem.py
+++ b/pyqtgraph/opengl/items/GLImageItem.py
@@ -1,6 +1,6 @@
from OpenGL.GL import *
from .. GLGraphicsItem import GLGraphicsItem
-from pyqtgraph.Qt import QtGui
+from ...Qt import QtGui
import numpy as np
__all__ = ['GLImageItem']
diff --git a/pyqtgraph/opengl/items/GLLinePlotItem.py b/pyqtgraph/opengl/items/GLLinePlotItem.py
index 23d227c9..a578dd1d 100644
--- a/pyqtgraph/opengl/items/GLLinePlotItem.py
+++ b/pyqtgraph/opengl/items/GLLinePlotItem.py
@@ -2,7 +2,7 @@ from OpenGL.GL import *
from OpenGL.arrays import vbo
from .. GLGraphicsItem import GLGraphicsItem
from .. import shaders
-from pyqtgraph import QtGui
+from ... import QtGui
import numpy as np
__all__ = ['GLLinePlotItem']
diff --git a/pyqtgraph/opengl/items/GLMeshItem.py b/pyqtgraph/opengl/items/GLMeshItem.py
index 5b245e64..14d178f8 100644
--- a/pyqtgraph/opengl/items/GLMeshItem.py
+++ b/pyqtgraph/opengl/items/GLMeshItem.py
@@ -1,9 +1,9 @@
from OpenGL.GL import *
from .. GLGraphicsItem import GLGraphicsItem
from .. MeshData import MeshData
-from pyqtgraph.Qt import QtGui
-import pyqtgraph as pg
+from ...Qt import QtGui
from .. import shaders
+from ... import functions as fn
import numpy as np
@@ -177,7 +177,7 @@ class GLMeshItem(GLGraphicsItem):
if self.colors is None:
color = self.opts['color']
if isinstance(color, QtGui.QColor):
- glColor4f(*pg.glColor(color))
+ glColor4f(*fn.glColor(color))
else:
glColor4f(*color)
else:
@@ -209,7 +209,7 @@ class GLMeshItem(GLGraphicsItem):
if self.edgeColors is None:
color = self.opts['edgeColor']
if isinstance(color, QtGui.QColor):
- glColor4f(*pg.glColor(color))
+ glColor4f(*fn.glColor(color))
else:
glColor4f(*color)
else:
diff --git a/pyqtgraph/opengl/items/GLScatterPlotItem.py b/pyqtgraph/opengl/items/GLScatterPlotItem.py
index b02a9dda..9ddd3b34 100644
--- a/pyqtgraph/opengl/items/GLScatterPlotItem.py
+++ b/pyqtgraph/opengl/items/GLScatterPlotItem.py
@@ -2,7 +2,7 @@ from OpenGL.GL import *
from OpenGL.arrays import vbo
from .. GLGraphicsItem import GLGraphicsItem
from .. import shaders
-from pyqtgraph import QtGui
+from ... import QtGui
import numpy as np
__all__ = ['GLScatterPlotItem']
diff --git a/pyqtgraph/opengl/items/GLSurfacePlotItem.py b/pyqtgraph/opengl/items/GLSurfacePlotItem.py
index 88d50fac..9c41a878 100644
--- a/pyqtgraph/opengl/items/GLSurfacePlotItem.py
+++ b/pyqtgraph/opengl/items/GLSurfacePlotItem.py
@@ -1,8 +1,7 @@
from OpenGL.GL import *
from .GLMeshItem import GLMeshItem
from .. MeshData import MeshData
-from pyqtgraph.Qt import QtGui
-import pyqtgraph as pg
+from ...Qt import QtGui
import numpy as np
diff --git a/pyqtgraph/opengl/items/GLVolumeItem.py b/pyqtgraph/opengl/items/GLVolumeItem.py
index 4980239d..84f23e12 100644
--- a/pyqtgraph/opengl/items/GLVolumeItem.py
+++ b/pyqtgraph/opengl/items/GLVolumeItem.py
@@ -1,6 +1,6 @@
from OpenGL.GL import *
from .. GLGraphicsItem import GLGraphicsItem
-from pyqtgraph.Qt import QtGui
+from ...Qt import QtGui
import numpy as np
__all__ = ['GLVolumeItem']
diff --git a/pyqtgraph/parametertree/Parameter.py b/pyqtgraph/parametertree/Parameter.py
index 9a7ece25..45e46e55 100644
--- a/pyqtgraph/parametertree/Parameter.py
+++ b/pyqtgraph/parametertree/Parameter.py
@@ -1,6 +1,6 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
import os, weakref, re
-from pyqtgraph.pgcollections import OrderedDict
+from ..pgcollections import OrderedDict
from .ParameterItem import ParameterItem
PARAM_TYPES = {}
diff --git a/pyqtgraph/parametertree/ParameterItem.py b/pyqtgraph/parametertree/ParameterItem.py
index 46499fd3..5a90becf 100644
--- a/pyqtgraph/parametertree/ParameterItem.py
+++ b/pyqtgraph/parametertree/ParameterItem.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
import os, weakref, re
class ParameterItem(QtGui.QTreeWidgetItem):
diff --git a/pyqtgraph/parametertree/ParameterTree.py b/pyqtgraph/parametertree/ParameterTree.py
index 866875e5..953f3bb7 100644
--- a/pyqtgraph/parametertree/ParameterTree.py
+++ b/pyqtgraph/parametertree/ParameterTree.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtCore, QtGui
-from pyqtgraph.widgets.TreeWidget import TreeWidget
+from ..Qt import QtCore, QtGui
+from ..widgets.TreeWidget import TreeWidget
import os, weakref, re
from .ParameterItem import ParameterItem
#import functions as fn
diff --git a/pyqtgraph/parametertree/parameterTypes.py b/pyqtgraph/parametertree/parameterTypes.py
index 3300171f..f58145dd 100644
--- a/pyqtgraph/parametertree/parameterTypes.py
+++ b/pyqtgraph/parametertree/parameterTypes.py
@@ -1,14 +1,14 @@
-from pyqtgraph.Qt import QtCore, QtGui
-from pyqtgraph.python2_3 import asUnicode
+from ..Qt import QtCore, QtGui
+from ..python2_3 import asUnicode
from .Parameter import Parameter, registerParameterType
from .ParameterItem import ParameterItem
-from pyqtgraph.widgets.SpinBox import SpinBox
-from pyqtgraph.widgets.ColorButton import ColorButton
-#from pyqtgraph.widgets.GradientWidget import GradientWidget ## creates import loop
-import pyqtgraph as pg
-import pyqtgraph.pixmaps as pixmaps
+from ..widgets.SpinBox import SpinBox
+from ..widgets.ColorButton import ColorButton
+#from ..widgets.GradientWidget import GradientWidget ## creates import loop
+from .. import pixmaps as pixmaps
+from .. import functions as fn
import os
-from pyqtgraph.pgcollections import OrderedDict
+from ..pgcollections import OrderedDict
class WidgetParameterItem(ParameterItem):
"""
@@ -141,7 +141,7 @@ class WidgetParameterItem(ParameterItem):
self.hideWidget = False
w.setFlat(True)
elif t == 'colormap':
- from pyqtgraph.widgets.GradientWidget import GradientWidget ## need this here to avoid import loop
+ from ..widgets.GradientWidget import GradientWidget ## need this here to avoid import loop
w = GradientWidget(orientation='bottom')
w.sigChanged = w.sigGradientChangeFinished
w.sigChanging = w.sigGradientChanged
@@ -304,11 +304,11 @@ class SimpleParameter(Parameter):
self.saveState = self.saveColorState
def colorValue(self):
- return pg.mkColor(Parameter.value(self))
+ return fn.mkColor(Parameter.value(self))
def saveColorState(self):
state = Parameter.saveState(self)
- state['value'] = pg.colorTuple(self.value())
+ state['value'] = fn.colorTuple(self.value())
return state
diff --git a/pyqtgraph/widgets/BusyCursor.py b/pyqtgraph/widgets/BusyCursor.py
index b013dda0..d99fe589 100644
--- a/pyqtgraph/widgets/BusyCursor.py
+++ b/pyqtgraph/widgets/BusyCursor.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
__all__ = ['BusyCursor']
diff --git a/pyqtgraph/widgets/CheckTable.py b/pyqtgraph/widgets/CheckTable.py
index dd33fd75..22015126 100644
--- a/pyqtgraph/widgets/CheckTable.py
+++ b/pyqtgraph/widgets/CheckTable.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from . import VerticalLabel
__all__ = ['CheckTable']
diff --git a/pyqtgraph/widgets/ColorButton.py b/pyqtgraph/widgets/ColorButton.py
index ee91801a..40f6740f 100644
--- a/pyqtgraph/widgets/ColorButton.py
+++ b/pyqtgraph/widgets/ColorButton.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore
-import pyqtgraph.functions as functions
+from ..Qt import QtGui, QtCore
+from .. import functions as functions
__all__ = ['ColorButton']
diff --git a/pyqtgraph/widgets/ColorMapWidget.py b/pyqtgraph/widgets/ColorMapWidget.py
index 26539d7e..1874f5d1 100644
--- a/pyqtgraph/widgets/ColorMapWidget.py
+++ b/pyqtgraph/widgets/ColorMapWidget.py
@@ -1,8 +1,8 @@
-from pyqtgraph.Qt import QtGui, QtCore
-import pyqtgraph.parametertree as ptree
+from ..Qt import QtGui, QtCore
+from .. import parametertree as ptree
import numpy as np
-from pyqtgraph.pgcollections import OrderedDict
-import pyqtgraph.functions as fn
+from ..pgcollections import OrderedDict
+from .. import functions as fn
__all__ = ['ColorMapWidget']
diff --git a/pyqtgraph/widgets/ComboBox.py b/pyqtgraph/widgets/ComboBox.py
index 1884648c..72ac384f 100644
--- a/pyqtgraph/widgets/ComboBox.py
+++ b/pyqtgraph/widgets/ComboBox.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.SignalProxy import SignalProxy
+from ..Qt import QtGui, QtCore
+from ..SignalProxy import SignalProxy
class ComboBox(QtGui.QComboBox):
diff --git a/pyqtgraph/widgets/DataFilterWidget.py b/pyqtgraph/widgets/DataFilterWidget.py
index c94f6c68..cae8be86 100644
--- a/pyqtgraph/widgets/DataFilterWidget.py
+++ b/pyqtgraph/widgets/DataFilterWidget.py
@@ -1,8 +1,8 @@
-from pyqtgraph.Qt import QtGui, QtCore
-import pyqtgraph.parametertree as ptree
+from ..Qt import QtGui, QtCore
+from .. import parametertree as ptree
import numpy as np
-from pyqtgraph.pgcollections import OrderedDict
-import pyqtgraph as pg
+from ..pgcollections import OrderedDict
+from .. import functions as fn
__all__ = ['DataFilterWidget']
@@ -108,7 +108,7 @@ class RangeFilterItem(ptree.types.SimpleParameter):
return mask
def describe(self):
- return "%s < %s < %s" % (pg.siFormat(self['Min'], suffix=self.units), self.fieldName, pg.siFormat(self['Max'], suffix=self.units))
+ return "%s < %s < %s" % (fn.siFormat(self['Min'], suffix=self.units), self.fieldName, fn.siFormat(self['Max'], suffix=self.units))
class EnumFilterItem(ptree.types.SimpleParameter):
def __init__(self, name, opts):
diff --git a/pyqtgraph/widgets/DataTreeWidget.py b/pyqtgraph/widgets/DataTreeWidget.py
index a6b5cac8..b99121bf 100644
--- a/pyqtgraph/widgets/DataTreeWidget.py
+++ b/pyqtgraph/widgets/DataTreeWidget.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.pgcollections import OrderedDict
+from ..Qt import QtGui, QtCore
+from ..pgcollections import OrderedDict
import types, traceback
import numpy as np
diff --git a/pyqtgraph/widgets/FeedbackButton.py b/pyqtgraph/widgets/FeedbackButton.py
index f788f4b6..30114d4e 100644
--- a/pyqtgraph/widgets/FeedbackButton.py
+++ b/pyqtgraph/widgets/FeedbackButton.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
__all__ = ['FeedbackButton']
diff --git a/pyqtgraph/widgets/FileDialog.py b/pyqtgraph/widgets/FileDialog.py
index 33b838a2..faa0994c 100644
--- a/pyqtgraph/widgets/FileDialog.py
+++ b/pyqtgraph/widgets/FileDialog.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
import sys
__all__ = ['FileDialog']
diff --git a/pyqtgraph/widgets/GradientWidget.py b/pyqtgraph/widgets/GradientWidget.py
index 7cbc032e..ce0cbeb9 100644
--- a/pyqtgraph/widgets/GradientWidget.py
+++ b/pyqtgraph/widgets/GradientWidget.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .GraphicsView import GraphicsView
-from pyqtgraph.graphicsItems.GradientEditorItem import GradientEditorItem
+from ..graphicsItems.GradientEditorItem import GradientEditorItem
import weakref
import numpy as np
diff --git a/pyqtgraph/widgets/GraphicsLayoutWidget.py b/pyqtgraph/widgets/GraphicsLayoutWidget.py
index 1e667278..3c34ca58 100644
--- a/pyqtgraph/widgets/GraphicsLayoutWidget.py
+++ b/pyqtgraph/widgets/GraphicsLayoutWidget.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtGui
-from pyqtgraph.graphicsItems.GraphicsLayout import GraphicsLayout
+from ..Qt import QtGui
+from ..graphicsItems.GraphicsLayout import GraphicsLayout
from .GraphicsView import GraphicsView
__all__ = ['GraphicsLayoutWidget']
diff --git a/pyqtgraph/widgets/GraphicsView.py b/pyqtgraph/widgets/GraphicsView.py
index fb535929..f3f4856a 100644
--- a/pyqtgraph/widgets/GraphicsView.py
+++ b/pyqtgraph/widgets/GraphicsView.py
@@ -5,23 +5,22 @@ Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
-from pyqtgraph.Qt import QtCore, QtGui
-import pyqtgraph as pg
+from ..Qt import QtCore, QtGui, USE_PYSIDE
try:
- from pyqtgraph.Qt import QtOpenGL
+ from ..Qt import QtOpenGL
HAVE_OPENGL = True
except ImportError:
HAVE_OPENGL = False
-from pyqtgraph.Point import Point
+from ..Point import Point
import sys, os
from .FileDialog import FileDialog
-from pyqtgraph.GraphicsScene import GraphicsScene
+from ..GraphicsScene import GraphicsScene
import numpy as np
-import pyqtgraph.functions as fn
-import pyqtgraph.debug as debug
-import pyqtgraph
+from .. import functions as fn
+from .. import debug as debug
+from .. import getConfigOption
__all__ = ['GraphicsView']
@@ -73,7 +72,7 @@ class GraphicsView(QtGui.QGraphicsView):
QtGui.QGraphicsView.__init__(self, parent)
if useOpenGL is None:
- useOpenGL = pyqtgraph.getConfigOption('useOpenGL')
+ useOpenGL = getConfigOption('useOpenGL')
self.useOpenGL(useOpenGL)
@@ -108,7 +107,7 @@ class GraphicsView(QtGui.QGraphicsView):
## Workaround for PySide crash
## This ensures that the scene will outlive the view.
- if pyqtgraph.Qt.USE_PYSIDE:
+ if USE_PYSIDE:
self.sceneObj._view_ref_workaround = self
## by default we set up a central widget with a grid layout.
@@ -138,7 +137,7 @@ class GraphicsView(QtGui.QGraphicsView):
"""
self._background = background
if background == 'default':
- background = pyqtgraph.getConfigOption('background')
+ background = getConfigOption('background')
brush = fn.mkBrush(background)
self.setBackgroundBrush(brush)
diff --git a/pyqtgraph/widgets/HistogramLUTWidget.py b/pyqtgraph/widgets/HistogramLUTWidget.py
index cbe8eb61..9aec837c 100644
--- a/pyqtgraph/widgets/HistogramLUTWidget.py
+++ b/pyqtgraph/widgets/HistogramLUTWidget.py
@@ -3,9 +3,9 @@ Widget displaying an image histogram along with gradient editor. Can be used to
This is a wrapper around HistogramLUTItem
"""
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .GraphicsView import GraphicsView
-from pyqtgraph.graphicsItems.HistogramLUTItem import HistogramLUTItem
+from ..graphicsItems.HistogramLUTItem import HistogramLUTItem
__all__ = ['HistogramLUTWidget']
diff --git a/pyqtgraph/widgets/JoystickButton.py b/pyqtgraph/widgets/JoystickButton.py
index 201a957a..6f73c8dc 100644
--- a/pyqtgraph/widgets/JoystickButton.py
+++ b/pyqtgraph/widgets/JoystickButton.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
__all__ = ['JoystickButton']
diff --git a/pyqtgraph/widgets/LayoutWidget.py b/pyqtgraph/widgets/LayoutWidget.py
index f567ad74..65d04d3f 100644
--- a/pyqtgraph/widgets/LayoutWidget.py
+++ b/pyqtgraph/widgets/LayoutWidget.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
__all__ = ['LayoutWidget']
class LayoutWidget(QtGui.QWidget):
diff --git a/pyqtgraph/widgets/MatplotlibWidget.py b/pyqtgraph/widgets/MatplotlibWidget.py
index 6a22c973..959e188a 100644
--- a/pyqtgraph/widgets/MatplotlibWidget.py
+++ b/pyqtgraph/widgets/MatplotlibWidget.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore, USE_PYSIDE
+from ..Qt import QtGui, QtCore, USE_PYSIDE
import matplotlib
if USE_PYSIDE:
diff --git a/pyqtgraph/widgets/MultiPlotWidget.py b/pyqtgraph/widgets/MultiPlotWidget.py
index 400bee92..58b71296 100644
--- a/pyqtgraph/widgets/MultiPlotWidget.py
+++ b/pyqtgraph/widgets/MultiPlotWidget.py
@@ -6,7 +6,7 @@ Distributed under MIT/X11 license. See license.txt for more infomation.
"""
from .GraphicsView import GraphicsView
-import pyqtgraph.graphicsItems.MultiPlotItem as MultiPlotItem
+from ..graphicsItems import MultiPlotItem as MultiPlotItem
__all__ = ['MultiPlotWidget']
class MultiPlotWidget(GraphicsView):
@@ -42,4 +42,4 @@ class MultiPlotWidget(GraphicsView):
self.mPlotItem.close()
self.mPlotItem = None
self.setParent(None)
- GraphicsView.close(self)
\ No newline at end of file
+ GraphicsView.close(self)
diff --git a/pyqtgraph/widgets/PathButton.py b/pyqtgraph/widgets/PathButton.py
index 7950a53d..0c62bb1b 100644
--- a/pyqtgraph/widgets/PathButton.py
+++ b/pyqtgraph/widgets/PathButton.py
@@ -1,5 +1,6 @@
-from pyqtgraph.Qt import QtGui, QtCore
-import pyqtgraph as pg
+from ..Qt import QtGui, QtCore
+from .. import functions as fn
+
__all__ = ['PathButton']
@@ -20,10 +21,10 @@ class PathButton(QtGui.QPushButton):
def setBrush(self, brush):
- self.brush = pg.mkBrush(brush)
+ self.brush = fn.mkBrush(brush)
def setPen(self, pen):
- self.pen = pg.mkPen(pen)
+ self.pen = fn.mkPen(pen)
def setPath(self, path):
self.path = path
diff --git a/pyqtgraph/widgets/PlotWidget.py b/pyqtgraph/widgets/PlotWidget.py
index 7b3c685c..f9b544f5 100644
--- a/pyqtgraph/widgets/PlotWidget.py
+++ b/pyqtgraph/widgets/PlotWidget.py
@@ -5,9 +5,9 @@ Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
from .GraphicsView import *
-from pyqtgraph.graphicsItems.PlotItem import *
+from ..graphicsItems.PlotItem import *
__all__ = ['PlotWidget']
class PlotWidget(GraphicsView):
diff --git a/pyqtgraph/widgets/ProgressDialog.py b/pyqtgraph/widgets/ProgressDialog.py
index 0f55e227..8c669be4 100644
--- a/pyqtgraph/widgets/ProgressDialog.py
+++ b/pyqtgraph/widgets/ProgressDialog.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
__all__ = ['ProgressDialog']
class ProgressDialog(QtGui.QProgressDialog):
diff --git a/pyqtgraph/widgets/RawImageWidget.py b/pyqtgraph/widgets/RawImageWidget.py
index 517f4f99..970b570b 100644
--- a/pyqtgraph/widgets/RawImageWidget.py
+++ b/pyqtgraph/widgets/RawImageWidget.py
@@ -1,12 +1,12 @@
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
try:
- from pyqtgraph.Qt import QtOpenGL
+ from ..Qt import QtOpenGL
from OpenGL.GL import *
HAVE_OPENGL = True
except ImportError:
HAVE_OPENGL = False
-import pyqtgraph.functions as fn
+from .. import functions as fn
import numpy as np
class RawImageWidget(QtGui.QWidget):
diff --git a/pyqtgraph/widgets/RemoteGraphicsView.py b/pyqtgraph/widgets/RemoteGraphicsView.py
index d44fd1c3..54712f43 100644
--- a/pyqtgraph/widgets/RemoteGraphicsView.py
+++ b/pyqtgraph/widgets/RemoteGraphicsView.py
@@ -1,8 +1,7 @@
-from pyqtgraph.Qt import QtGui, QtCore, USE_PYSIDE
+from ..Qt import QtGui, QtCore, USE_PYSIDE
if not USE_PYSIDE:
import sip
-import pyqtgraph.multiprocess as mp
-import pyqtgraph as pg
+from .. import multiprocess as mp
from .GraphicsView import GraphicsView
import numpy as np
import mmap, tempfile, ctypes, atexit, sys, random
diff --git a/pyqtgraph/widgets/ScatterPlotWidget.py b/pyqtgraph/widgets/ScatterPlotWidget.py
index e9e24dd7..02f260ca 100644
--- a/pyqtgraph/widgets/ScatterPlotWidget.py
+++ b/pyqtgraph/widgets/ScatterPlotWidget.py
@@ -1,12 +1,13 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from .PlotWidget import PlotWidget
from .DataFilterWidget import DataFilterParameter
from .ColorMapWidget import ColorMapParameter
-import pyqtgraph.parametertree as ptree
-import pyqtgraph.functions as fn
+from .. import parametertree as ptree
+from .. import functions as fn
+from .. import getConfigOption
+from ..graphicsItems.TextItem import TextItem
import numpy as np
-from pyqtgraph.pgcollections import OrderedDict
-import pyqtgraph as pg
+from ..pgcollections import OrderedDict
__all__ = ['ScatterPlotWidget']
@@ -48,9 +49,9 @@ class ScatterPlotWidget(QtGui.QSplitter):
self.ctrlPanel.addWidget(self.ptree)
self.addWidget(self.plot)
- bg = pg.mkColor(pg.getConfigOption('background'))
+ bg = fn.mkColor(getConfigOption('background'))
bg.setAlpha(150)
- self.filterText = pg.TextItem(border=pg.getConfigOption('foreground'), color=bg)
+ self.filterText = TextItem(border=getConfigOption('foreground'), color=bg)
self.filterText.setPos(60,20)
self.filterText.setParentItem(self.plot.plotItem)
@@ -193,7 +194,7 @@ class ScatterPlotWidget(QtGui.QSplitter):
imax = int(xy[ax].max()) if len(xy[ax]) > 0 else 0
for i in range(imax+1):
keymask = xy[ax] == i
- scatter = pg.pseudoScatter(xy[1-ax][keymask], bidir=True)
+ scatter = fn.pseudoScatter(xy[1-ax][keymask], bidir=True)
if len(scatter) == 0:
continue
smax = np.abs(scatter).max()
diff --git a/pyqtgraph/widgets/SpinBox.py b/pyqtgraph/widgets/SpinBox.py
index 57e4f1ed..422522de 100644
--- a/pyqtgraph/widgets/SpinBox.py
+++ b/pyqtgraph/widgets/SpinBox.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.python2_3 import asUnicode
-from pyqtgraph.SignalProxy import SignalProxy
+from ..Qt import QtGui, QtCore
+from ..python2_3 import asUnicode
+from ..SignalProxy import SignalProxy
-import pyqtgraph.functions as fn
+from .. import functions as fn
from math import log
from decimal import Decimal as D ## Use decimal to avoid accumulating floating-point errors
from decimal import *
diff --git a/pyqtgraph/widgets/TableWidget.py b/pyqtgraph/widgets/TableWidget.py
index 8ffe7291..03392648 100644
--- a/pyqtgraph/widgets/TableWidget.py
+++ b/pyqtgraph/widgets/TableWidget.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.python2_3 import asUnicode
+from ..Qt import QtGui, QtCore
+from ..python2_3 import asUnicode
import numpy as np
try:
diff --git a/pyqtgraph/widgets/TreeWidget.py b/pyqtgraph/widgets/TreeWidget.py
index 97fbe953..ec2c35cf 100644
--- a/pyqtgraph/widgets/TreeWidget.py
+++ b/pyqtgraph/widgets/TreeWidget.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
from weakref import *
__all__ = ['TreeWidget', 'TreeWidgetItem']
diff --git a/pyqtgraph/widgets/ValueLabel.py b/pyqtgraph/widgets/ValueLabel.py
index 7f6fa84b..d395cd43 100644
--- a/pyqtgraph/widgets/ValueLabel.py
+++ b/pyqtgraph/widgets/ValueLabel.py
@@ -1,6 +1,6 @@
-from pyqtgraph.Qt import QtCore, QtGui
-from pyqtgraph.ptime import time
-import pyqtgraph as pg
+from ..Qt import QtCore, QtGui
+from ..ptime import time
+from .. import functions as fn
from functools import reduce
__all__ = ['ValueLabel']
@@ -67,7 +67,7 @@ class ValueLabel(QtGui.QLabel):
avg = self.averageValue()
val = self.values[-1][1]
if self.siPrefix:
- return pg.siFormat(avg, suffix=self.suffix)
+ return fn.siFormat(avg, suffix=self.suffix)
else:
return self.formatStr.format(value=val, avgValue=avg, suffix=self.suffix)
diff --git a/pyqtgraph/widgets/VerticalLabel.py b/pyqtgraph/widgets/VerticalLabel.py
index fa45ae5d..c8cc80bd 100644
--- a/pyqtgraph/widgets/VerticalLabel.py
+++ b/pyqtgraph/widgets/VerticalLabel.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
__all__ = ['VerticalLabel']
#class VerticalLabel(QtGui.QLabel):